Download the PHP package samuelterra22/laravel-report-generator without Composer
On this page you can find all versions of the php package samuelterra22/laravel-report-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samuelterra22/laravel-report-generator
More information about samuelterra22/laravel-report-generator
Files in samuelterra22/laravel-report-generator
Package laravel-report-generator
Short Description Rapidly Generate Simple Pdf & Excel Report on Laravel 6 (Using Barryvdh/DomPdf or Barryvdh/laravel-snappy & maatwebsite/excel)
License MIT
Informations about the package laravel-report-generator
Laravel Report Generators (PDF & Excel)
This package is inspired by the package of Jimmy-JS. Thanks Jimmy-JS.
Rapidly Generate Simple Pdf Report on Laravel (Using barryvdh/laravel-dompdf or barryvdh/laravel-snappy) or Excel Report (using Maatwebsite/Laravel-Excel)
This package provides a simple pdf & excel report generators to speed up your workflow
Installation
Add package to your composer:
composer require samuelterra22/laravel-report-generator
Then, add the ServiceProvider to the providers array in config/app.php
SamuelTerra22\ReportGenerator\ServiceProvider::class,
Optionally, you can add this to your aliases array in config/app.php
'PdfReport' => SamuelTerra22\ReportGenerator\Facades\PdfReportFacade::class,
'ExcelReport' => SamuelTerra22\ReportGenerator\Facades\ExcelReportFacade::class,
'CSVReport' => SamuelTerra22\ReportGenerator\Facades\CSVReportFacade::class,
Usage
This package is make use of chunk
method (Eloquent / Query Builder) so it can handle big data without memory exhausted.
Also, You can use PdfReport
, ExcelReport
or CSVReport
facade for shorter code that already registered as an alias.
Example Display PDF Code
Note: For downloading to excel, just change PdfReport
facade to ExcelReport
facade no more modifications
Data Manipulation
Will produce a same result with:
So you can do some eager loading relation like:
Output Report
Example Code With Group By
Or, you can total all records by group using groupBy
method
PLEASE TAKE NOTE TO SORT GROUPBY COLUMN VIA QUERY FIRST TO USE THIS GROUP BY METHOD.
Output Report With Group By Registered At
Other Method
1. setPaper($paper = 'a4')
Supported Media Type: PDF
Description: Set Paper Size
Params:
- $paper (Default: 'a4')
Usage:
2. setCss(Array $styles)
Supported Media Type: PDF, Excel
Description: Set a new custom styles with given selector and style to apply
Params:
- Array $styles (Key: $selector, Value: $style)
Usage:
3. setOrientation($orientation = 'portrait')
Supported Media Type: PDF
Description: Set Orientation to Landscape or Portrait
Params:
- $orientation (Default: 'portrait')
Usage:
4. withoutManipulation()
Supported Media Type: PDF, Excel, CSV
Description: Faster generating report, but all columns properties must be matched the selected column from SQL Queries
Usage:
5. showMeta($value = true)
Supported Media Type: PDF, Excel, CSV
Description: Show / hide meta attribute on report
Params:
- $value (Default: true)
Usage:
6. showHeader($value = true)
Supported Media Type: PDF, Excel, CSV
Description: Show / hide column header on report
Params:
- $value (Default: true)
Usage: