PHP code example of koolreport / laravel

1. Go to this page and download the library: Download koolreport/laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

koolreport / laravel example snippets



use \koolreport\widgets\koolphp\Table;



namespace App\Http\Controllers;

use App\Reports\MyReport;

class HomeController extends Controller
{
public function __contruct()
    {
        $this->middleware("guest");
    }
    public function index()
    {
        $report = new MyReport;
        $report->run();
        return view("report",["report"=>$report]);
    }
}

 $report->render(); 

class MyReport extends \koolreport\KoolReport
{
    use \koolreport\laravel\Friendship;
    function settings()
    {
        return array(
            "dataSources"=>array(
                "csv_source"=>array(
                    "class"=>'\koolreport\datasources\CSVDataSource',
                    'filePath'=>dirname(__FILE__)."\mycsvdata.csv",
                )
            )
        );
    }
}

class MyReport extends \koolreport\KoolReport
{
    function settings()
    {
        return array(
            "assets"=>array(
                "path"=>"../../public/resources/kool"
                "url"=>"resources/kool"
            )
        );
    }
}