lucasvscn / laravel-pdf-report
Blade components to build PDF reports.
1.0.0
2022-02-17 20:02 UTC
Requires
- php: ^8.0.2
- illuminate/support: ^9.0
Requires (Dev)
- gajus/dindent: ^2.0
- orchestra/testbench: ^7.0.2
- phpunit/phpunit: ^9.5
Suggests
- barryvdh/laravel-dompdf: Easy integration of DOMPdf with Laravel.
This package is auto-updated.
Last update: 2025-01-09 20:41:35 UTC
README
Blade components to build PDF reports using DOMPdf.
Install
Download the package with Composer.
composer require lucasvscn/laravel-pdf-report
Then install command will copy the assets into your application's folder.
php artisan laravel-pdf-report:install
Compile your assets (optional).
npm run dev
Usage
Now you can use this blade components to build your layout.
<!-- PATH: resources/views/pdf/report.blade.php --> <x-pdf-report> <x-slot name="header"> <h1>Report header</h1> </x-slot> <x-slot name="footer"> Page <span class="page_number"></span> </x-slot> <x-pdf-page> Content for the 1st page. </x-pdf-page> <x-pdf-page> Content for the nth page... </x-pdf-page> </x-pdf-report>
Generate the PDF using barryvdh/laravel-dompdf package.
use Barryvdh\DomPDF\Facade\Pdf; $pdf = Pdf::loadView('pdf.report'); return $pdf->stream();
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.