yaroslawww / laravel-inertia-dashboard
Laravel inertia dashboard development kit for quicker MVP ot live projects.
1.0.0
2022-11-24 16:26 UTC
Requires
- php: ^8.1
- illuminate/support: ^9.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.13
- orchestra/testbench: ^7.11
- phpunit/phpunit: ^9.5
- psalm/plugin-laravel: ^2.0
- vimeo/psalm: ^4.29
README
Laravel inertia dashboard development kit for quicker MVP ot live projects.
Installation
Install the package via composer:
composer require yaroslawww/laravel-inertia-dashboard
Optionally you can publish the config file with:
php artisan vendor:publish --provider="InertiaDashboardKit\ServiceProvider" --tag="config"
Usage
return Inertia::render('Admin/Issue/ShowPage', [ 'translations' => get_ads_translations('issue-page'), 'indexData' => IndexData::make( $request, (new AdvAsset())->getMorphClass(), $lineItemIssue->assets() ) ->perPage(9) ->useResource( AttachedAssetResource::class, [ 'actions' => function (AdvAsset $entity, $user, $request) use ($lineItemIssue) { $actions = []; if ( $user->can('update', $lineItemIssue) && !$entity->pivot ->isStatus(\App\Domain\Advertising\Enums\AssetStatus::APPROVED) ) { $actions[] = (new DetachAction()) ->setDetachable($lineItemIssue, 'assets'); } return $actions; }, ] ) ->bulkActions([]) ->columns($columns) ->toResponseArray(), ]);