I need a reporting Laravel package that i can link to my project to be able to generate php reports with pdf export option. Code example will be very helpful!
There are many Laravel packages that you can use for reporting, the following package, I believe, is a good example:
A well-documented PHP reporting framework (with many code examples). It's available as a native PHP engine and as a laravel package. Here is a code example of how to use it to convert a SQL query into a report.
$report = new ReportOptions(Constants::SRE_PUBLIC_REPORT, Constants::SRE_SQL,"SQL_01");
$report->set_sql("select * from items where `Units_In_Stock` < 15 ")
->set_header("Header goes here")
->set_grouping(array("country"))
->label("id", "Product ID")
->select_all_fields();
$engine = new CustomEngine($report);
$report_path = $engine->create_report();
Using this engine you can generate public reports or integrate the engine with your existing login system to generate private reports. Here is how