mortezamasumi/fb-report

Generate PDF reports using mPDF for Filament.

Maintainers

Package info

github.com/mortezamasumi/fb-report

pkg:composer/mortezamasumi/fb-report

Transparency log

Statistics

Installs: 223

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v5.1.0 2026-08-02 05:49 UTC

README

Latest Version on Packagist CI Tests Total Downloads License

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.