PHP code example of bernadev / laravel-reports

1. Go to this page and download the library: Download bernadev/laravel-reports 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/ */

    

bernadev / laravel-reports example snippets


    public function __construct(array $input_data=array())
    {
        $this->filters = [
            'start_date' => ['name' => 'Start Date', 'value' => NULL, 'type' => 'date'],
            'end_date' => ['name' => 'End Date', 'value' => NULL, 'type' => 'date']
        ];

        if (Arr::get($input_data, 'start_date'))
        {
            $this->filters['start_date']['value'] = MY::parseDate($input_data['start_date'])->startOfDay();
        }
        else
        {
            $this->filters['start_date']['value'] = now()->subMonth()->startOfDay();
        }

        if (Arr::get($input_data, 'end_date'))
        {
            $this->filters['end_date']['value'] = MY::parseDate($input_data['end_date'])->endOfDay();
        }
        else
        {
            $this->filters['end_date']['value'] = now()->endOfDay();
        }
    }