Download the PHP package jimmyjs/laravel-report-generator without Composer
On this page you can find all versions of the php package jimmyjs/laravel-report-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jimmyjs/laravel-report-generator
More information about jimmyjs/laravel-report-generator
Files in jimmyjs/laravel-report-generator
Package laravel-report-generator
Short Description Rapidly Generate Simple Pdf & Excel Report on Laravel 5 (Using Barryvdh/DomPdf or Barryvdh/laravel-snappy & maatwebsite/excel)
License MIT
Informations about the package laravel-report-generator
Laravel Report Generators (PDF, CSV & Excel)
Rapidly Generate Simple Pdf Report on Laravel (Using barryvdh/laravel-dompdf or barryvdh/laravel-snappy) or CSV / Excel Report (using Maatwebsite/Laravel-Excel)
This package provides a simple pdf, csv & excel report generators to speed up your workflow. It also allows you to stream(), download(), or store() the report seamlessly.
Version
Version | Laravel Version | Php Version | Maatwebsite/Excel Ver | Feature |
---|---|---|---|---|
1.0 | <= 5.6 | <=7.0 | ~2.1.0 | using chunk() to handle big data |
1.1 | <= 5.6 | <=7.0 | ~2.1.0 | using cursor() to handle big data |
2.0 | >= 5.5 | ^7.0 | ^3.1 | Using new version of maatwebsite (v3.1) |
Find the comparison between chunk
and cursor
in here
Installation
Add package to your composer:
composer require jimmyjs/laravel-report-generator
If you are running Laravel > 5.5 that's all you need to do. If you are using Laravel < 5.5 add the ServiceProvider to the providers array in config/app.php
Jimmyjs\ReportGenerator\ServiceProvider::class,
Optionally, you can add this to your aliases array in config/app.php
'PdfReport' => Jimmyjs\ReportGenerator\Facades\PdfReportFacade::class,
'ExcelReport' => Jimmyjs\ReportGenerator\Facades\ExcelReportFacade::class,
'CSVReport' => Jimmyjs\ReportGenerator\Facades\CSVReportFacade::class,
Optionally, You can publish the config file (then it will be available in config/report-generator.php
)
php artisan vendor:publish --provider="Jimmyjs\ReportGenerator\ServiceProvider"
If you want to generate a pdf report, please install either dompdf / snappy pdf.
This package will automatically use snappy pdf. If you want to use dompdf then please change config/report-generator.php
:
return [
'flush' => false,
'pdfLibrary' => 'dompdf'
];
For better speed on generating pdf report, I recommend you to use laravel snappy package. To using laravel snappy, you should install wkhtmltopdf
to work with this package (Jump to wkhtmltopdf installation)
Example Display PDF Code
Note: For downloading to excel / CSV, just change PdfReport
facade to ExcelReport
/ CSVReport
facade with no more modifications
Data Manipulation
Will produce a same result with:
Report Output
With this manipulation, you could do some eager loading relation like:
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
Wkhtmltopdf Installation
- Download wkhtmltopdf from https://wkhtmltopdf.org/downloads.html
- Change your snappy config located in
/config/snappy.php
(runphp artisan vendor:publish
ifsnappy.php
file is not created) to:
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:
7. showNumColumn($value = true)
Supported Media Type: PDF, Excel, CSV
Description: Show / hide number column on report
Params:
- $value (Default: true)
Usage:
8. simple()
Supported Media Type: Excel
Description: Generate excel in simple mode (no styling on generated excel report, but faster in generating report)
Params:
- None
Usage: