mblsolutions / report
Laravel Report package
Installs: 5 889
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 6
Open Issues: 4
Type:package
Requires
- php: ^8.0
- ext-json: *
- doctrine/dbal: ^3.3
- illuminate/cache: ^9.0|^10.0
- illuminate/console: ^9.0|^10.0
- illuminate/contracts: ^9.0|^10.0
- illuminate/database: ^9.0|^10.0
- illuminate/events: ^9.0|^10.0
- illuminate/filesystem: ^9.0|^10.0
- illuminate/http: ^9.0|^10.0
- illuminate/queue: ^9.0|^10.0
- illuminate/support: ^9.0|^10.0
- laravel/legacy-factories: ^1.2
- lerouse/laravel-repository: ^2.4
- maatwebsite/excel: ^3.1
- psr/simple-cache: ^2.0
Requires (Dev)
- mockery/mockery: ~1.0
- orchestra/testbench: ^7.0
- phpunit/phpunit: ^9.6
- dev-master
- v5.2.1
- v5.2.0
- v5.1.0
- v5.0.0
- v4.x-dev
- v4.3.1
- v4.3.0
- v4.2.0
- v3.x-dev
- v3.2.0
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.1
- v3.0.0
- v2.x-dev
- v2.7.7
- v2.7.6
- v2.7.5
- v2.7.4
- v2.7.3
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.0
- v2.5.0
- v2.4.1
- v2.4.0
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.2
- v2.0.0
- v1.x-dev
- v1.3.0
- v1.2
- v1.1.1
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-bugfix/raw-key-on-preview
- dev-AB+53749-Report-Package-Publish-Migrations-Conditionally--master
- dev-AB+53749-Report-Package-Publish-Migrations-master
- dev-AB+53749-Report-Package-Publish-Migrations-Conditionally
- dev-bugfix/AB+53749-Report-Package-Publish-Migrations
- dev-feature/laravel-v10-upgrade
This package is auto-updated.
Last update: 2024-11-21 09:51:04 UTC
README
Import Laravel Reporting into any Laravel 6+ application using this package.
Installation
Install Laravel Report with composer.
php composer require mblsolutions/report
Copy the package config to your local config.
php artisan vendor:publish --tag=report-config
Copy the package database migrations.
php artisan vendor:publish --tag=report-migrations
Laravel Report comes with its own database migrations, once the package has been installed run the migrations.
php artisan migrate
Usage
Once the package has been required into your project you can configure which parts of the package you would like to use.
Routes
To enable the package json api routes in your application add the following to your routes file.
Report::routes();
Manage routes
To configure custom middleware/guards around report management/creation only routes.
Report::manageRoutes();
View Routes
To configure custom middleware/guards around report view only routes.
Report::viewRoutes();
Export Routes
To configure custom middleware/guards around report export result only routes.
Report::exportRoutes();
Applying Custom Middleware/Gates
To apply middleware to the routes, wrap the routes in middleware groups.
Route::middleware(['admin'])->group(function () { Report::manageRoutes(); }); Route::middleware(['user'])->group(function () { Report::viewRoutes(); }); Route::middleware(['web'])->group(function () { Report::exportRoutes(); });
To apply gates to the routes, wrap the routes in middleware groups.
Route::middleware(['can:manage-reports'])->group(function () { Report::manageRoutes(); }); Route::middleware(['can:view-reports'])->group(function () { Report::viewRoutes(); });
Report Select Parameter Models
To enable select options when creating/rendering reports, you must add the available model types to be reported on in the
report.php
config file. Any models added to this array will be available when creating new report fields.
Models added to the array should implement the \MBLSolutions\Report\Interfaces\PopulatesReportOption
interface
Please Note: We recommend that large record sets are not used as select types, due to usability/browser performance issues.
[ 'models' => [ \App\User::class, \App\Order::class ] ]
Scheduled Reporting
To enable scheduled reporting add the following line into the schedule
method of the \App\Console\Kernel
file of your
laravel application.
$schedule->command(\MBLSolutions\Report\Console\Commands\DispatchScheduledReportsCommand::class)->hourly();
Report JSON API
The following endpoints are available to you once the routes have been added:
View Routes (synchronous)
Queued View Routes (asynchronous)
Scheduled Report Routes
Export Routes
Manage Routes
Report Events
Events are fired at critical points during report creation/completion