bharatbkj / filament-report-builder
Filament panel integration for the Laravel natural-language Report Builder.
Package info
github.com/bharatbkj/filament-report-builder
Language:Blade
pkg:composer/bharatbkj/filament-report-builder
Requires
- php: ^8.2
- bharatbkj/laravel-report-builder: ^1.0
- filament/filament: ^3.2 || ^4.0 || ^5.0
README
Filament panel plugin for bharatbkj/laravel-report-builder. It adds a Report Builder page where authorized panel users can submit plain-English questions and view safe report results from configured application data.
Features
- Filament panel navigation page.
- Uses the shared Laravel Report Builder query engine.
- Compact query composer with execution animation.
- Responsive report table with visible-row filtering.
- CSV, JSON, and Print PDF actions.
- Optional authorization ability.
- No SQL query displayed in the panel.
Requirements
- PHP 8.2 or newer.
- Laravel supported by
bharatbkj/laravel-report-builder(currently Laravel 11 or Laravel 12). - Filament
^3.2,^4.0, or^5.0, as resolved for the host Laravel application.
The plugin uses the panel-plugin and custom-page APIs shared by Filament 3, 4, and 5. It does not depend on version-specific table or form schema APIs.
Install
After both packages are available through Packagist:
composer require bharatbkj/filament-report-builder php artisan vendor:publish --tag=report-builder-config php artisan vendor:publish --tag=report-builder-migrations php artisan migrate
The core Report Builder package is installed automatically as a dependency.
Optionally publish the Filament plugin configuration or view:
php artisan vendor:publish --tag=filament-report-builder-config php artisan vendor:publish --tag=filament-report-builder-views
Register The Plugin
In the relevant Filament panel provider:
use Bharatbkj\FilamentReportBuilder\ReportBuilderPlugin; use Filament\Panel; public function panel(Panel $panel): Panel { return $panel ->plugin(ReportBuilderPlugin::make()); }
A Report Builder page is added to that panel.
Configure Report Data
The plugin reads the core package configuration from config/report-builder.php. No tables are accessible until explicitly allowed:
'allowed_tables' => [ 'students' => [ 'label' => 'Students', 'aliases' => ['student', 'learners'], ], 'student_attendances' => [ 'label' => 'Attendance', 'aliases' => ['attendance', 'attendances'], ], ], 'column_aliases' => [ 'student_attendances' => [ 'attendance_percent' => ['attendance', 'attendance percentage'], ], ], 'relationships' => [ [ 'left_table' => 'students', 'left_key' => 'id', 'right_table' => 'student_attendances', 'right_key' => 'student_id', 'aliases' => ['attendance', 'attendances'], ], ], 'value_lookup_columns' => [ 'students' => ['name', 'course'], ],
The core package remains responsible for protected-column filtering, query parsing, safe joins, maximum rows, and audit logging.
Restrict Page Access
By default, any authenticated user who can access the configured Filament panel can access Report Builder. To require an application permission, publish the plugin config and set an ability:
// config/filament-report-builder.php 'authorization' => [ 'ability' => 'use-report-builder', ],
The authenticated panel user must pass can('use-report-builder').
Local Package Development
When developing both packages from local folders, add both repositories to a host application's composer.json:
{
"repositories": [
{
"type": "path",
"url": "packages/report-builder"
},
{
"type": "path",
"url": "packages/filament-report-builder"
}
]
}
Then install:
composer require bharatbkj/filament-report-builder:@dev
Package Boundary
bharatbkj/laravel-report-builder contains the report engine and database safety controls. bharatbkj/filament-report-builder contains only the Filament page integration and panel user experience. This separation keeps parsing and authorization behavior consistent for normal Laravel screens, APIs, and Filament panels.