Download the PHP package elgibor-solution/laravel-report-builder without Composer
On this page you can find all versions of the php package elgibor-solution/laravel-report-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elgibor-solution/laravel-report-builder
More information about elgibor-solution/laravel-report-builder
Files in elgibor-solution/laravel-report-builder
Package laravel-report-builder
Short Description A metadata-driven dynamic reporting engine for Laravel — definitions, sources, parameters, filters, grouping, aggregates, formulas, drilldowns, subreports, and HTML/PDF/Excel/CSV/JSON output.
License MIT
Informations about the package laravel-report-builder
Laravel Advanced Reports
elgibor-solution/laravel-report-builder is a metadata-driven reporting engine for Laravel. It runs registered report sources through definitions containing columns, parameters, filters, sorting, grouping, aggregates, formulas, drilldowns, subreports, and conditional formatting. Results can be rendered as HTML, JSON, CSV, PDF, or XLSX.
Requirements
- PHP 8.2 or newer.
- Laravel components 10, 11, 12, or 13.
- Laravel 13 requires PHP 8.3 or newer.
- SQLite, MySQL, PostgreSQL, or another database supported by the configured Laravel connection.
Optional render dependencies:
barryvdh/laravel-dompdffor the default PDF renderer.maatwebsite/excelfor XLSX rendering.spatie/browsershotcan be used as an alternative PDF driver.
The dynamic data-source bridge also expects the ESolution\\DataSources\\Models\\DataSource and DataSourceParameter models supplied by the related data-sources package when that integration is used.
Installation
The service provider is auto-discovered. The installer publishes the configuration, migrations, and views and can run the migrations. They can also be published individually:
Run migrations manually when preferred:
The migrations create report definitions, runs, exports, snapshots, schedules, permissions, and connected-source records. The reports migration has an optional foreign key to users.created_by; applications using that migration should have their users table available first.
Configuration
The package uses config/advanced-reports.php. It controls the database connection and table prefix, permission and tenant settings, renderer classes, PDF options, synchronous/queued export behavior, cache and row limits, run history, route prefixes/middleware, and designer settings.
The default API prefix is api/advanced-reports. API routes are enabled by default; web preview/download routes are disabled by default. Environment variables documented in the configuration file can override these settings, including ADVANCED_REPORTS_API_PREFIX, ADVANCED_REPORTS_WEB_PREFIX, ADVANCED_REPORTS_PDF_DRIVER, ADVANCED_REPORTS_QUEUE_EXPORTS, and the security/performance variables.
Report sources
Create a source by using the included generator:
A source extends ReportSource, declares a key, label, fields, optional parameters, and a query:
Register the source from an application service provider:
Fields support the existing types string, integer, decimal, boolean, date, datetime, and json; they can be sortable, filterable, aggregatable, hidden, and formatted. Parameters support string, integer, decimal, boolean, date, datetime, and array.
Report definitions and execution
Definitions are arrays or ReportDefinition objects. The persisted Report model stores the definition as JSON:
The manager also exposes definition, resolveReport, authorize, sources, source, registerSource, fields, and listRegisteredSources. The facade exposes the corresponding report operations shown above.
HTTP routes
When enabled, the API provides source listing/schema and dynamic-source endpoints, report CRUD, inline and persisted previews, report runs, synchronous exports, export lookup, and export downloads. Routes use the configured prefix and middleware.
Optional web routes provide:
GET /advanced-reports/reports/{report}/previewGET /advanced-reports/reports/{report}/download
Enable them with ADVANCED_REPORTS_WEB_ROUTES=true or the equivalent configuration value. Route authentication and authorization should be supplied by the application middleware and policy configuration.
Customization
The service provider publishes resources/views/vendor/advanced-reports for customized HTML/PDF views. Renderer classes are configurable under renderers; custom implementations can implement ReportRenderer or ReportExporter and be registered in application configuration/container bindings. PDF supports dompdf, browsershot, and a custom tagged engine binding as described in the configuration file.
Console commands
advanced-reports:cleanup-runs removes old runs and expired export records/files according to configuration, or reports what it would remove with --dry-run.
Testing
The test suite uses Orchestra Testbench and an in-memory SQLite database. PHPUnit is configured to run both tests/Unit and tests/Feature.
License
This package is released under the MIT license.
All versions of laravel-report-builder with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
symfony/expression-language Version ^6.0|^7.0
dragonmantank/cron-expression Version ^3.0|^4.0