webard / nova-biloquent
Installs: 2 316
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- laravel/nova: ^4.29.8
- webard/biloquent: ^1.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-03-04 19:04:04 UTC
README
Reports for Eloquent models, displayed as Nova resource.
See http://github.com/webard/biloquent for more info.
Package is under development and in very early stage.
Define Resource
Sample base on Order model with total and created_at fields required.
Create file App\Nova\OrderReport.php
:
declare(strict_types=1); namespace App\Nova; use Webard\NovaBiloquent\NovaReport; use Laravel\Nova\Fields\BelongsTo; use Laravel\Nova\Fields\Number; use Laravel\Nova\Fields\Text; use Laravel\Nova\Http\Requests\NovaRequest; use App\Nova\User; class OrderReport extends NovaReport { public static $model = \App\Reports\OrderReport::class; public static string $datasetResource = \App\Nova\Order::class; public function reportFields(NovaRequest $request): array { return [ Text::make('Year', 'year')->sortable(), Text::make('Month', 'month')->sortable(), Text::make('Day', 'day')->sortable(), Text::make('Date', 'date')->sortable(), BelongsTo::make('Customer', 'customer', User::class)->sortable(), Number::make('Total orders', 'total_orders')->sortable()->filterable(), Number::make('Avg. amount', 'average_amount')->sortable()->filterable(), ]; } }