mortezamasumi / fb-report
Generate PDF reports using mPDF for Filament.
Requires
- php: ^8.3
- carlos-meneses/laravel-mpdf: ^2.1.11
- filament/filament: ^5.0
- mortezamasumi/fb-essentials: ^5.0
- spatie/laravel-package-tools: ^1.0
Requires (Dev)
- filament/upgrade: ^5.0
- larastan/larastan: ^3.10
- laravel/pint: ^1.30
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-browser: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-livewire: ^4.0
- phpstan/phpstan: ^2.2
- smalot/pdfparser: ^2.12
- symfony/dom-crawler: ^7.3
This package is auto-updated.
Last update: 2026-08-02 05:53:17 UTC
README
Generate PDF reports using mPDF for Filament tables and bulk actions.
Features
- Generate PDF reports from Filament table data with a single
->reporter()call. - Support for grouped and sub-grouped data across multiple pages.
- Persian/Arabic font support out of the box with 24 bundled fonts.
- Configurable page format, orientation, margins, and PDF protection password.
- Column formatting helpers for Jalali dates and locale-aware digits.
Installation
composer require mortezamasumi/fb-report
Configuration
You can publish the config file with:
php artisan vendor:publish --tag="fb-report-config"
The published config/fb-report.php lets you set the default PDF password, font directory, and bundled font definitions.
Usage
Create a reporter class extending Reporter and implement getColumns(), getGroupItems(), and getTableRowsData():
use Mortezamasumi\FbReport\Reports\Reporter; class StudentRegisterFormReporter extends Reporter { public function getConfig(): array { return [ 'margin_top' => 0, 'margin_right' => 5, 'margin_left' => 5, 'margin_bottom' => 0, ]; } protected function getGroupItems(): ?Collection { return $this->getRecords(); } public function getTableRowsData(): Collection { return $this->getRecords(); } }
Then attach it to a Filament table or bulk action:
Table::make() ->reporter(StudentRegisterFormReporter::class)
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
License
The MIT License (MIT). Please see License File for more information.