lucasvscn / laravel-pdf-report
Blade components to build PDF reports.
Installs: 165
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
pkg:composer/lucasvscn/laravel-pdf-report
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-09-09 22:08:22 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.