Download the PHP package jhosep32/laravel-report without Composer
On this page you can find all versions of the php package jhosep32/laravel-report. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jhosep32/laravel-report
More information about jhosep32/laravel-report
Files in jhosep32/laravel-report
Package laravel-report
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
Laravel Report Generators (PDF & Excel)
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 jimmyjs/laravel-report-generator
Then, add the ServiceProvider to the providers array in config/app.php
Jimmyjs\ReportGenerator\ServiceProvider::class,
For more 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)
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,
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 / 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: