PHP code example of yaroslawww / laravel-inertia-dashboard

1. Go to this page and download the library: Download yaroslawww/laravel-inertia-dashboard library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yaroslawww / laravel-inertia-dashboard example snippets


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(),
        ]);
bash
php artisan vendor:publish --provider="InertiaDashboardKit\ServiceProvider" --tag="config"