PHP code example of tomatophp / filament-artisan

1. Go to this page and download the library: Download tomatophp/filament-artisan 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/ */

    

tomatophp / filament-artisan example snippets


->plugin(\TomatoPHP\FilamentArtisan\FilamentArtisanPlugin::make())

->plugin(
    \TomatoPHP\FilamentArtisan\FilamentArtisanPlugin::make()
        // only super admins may open the page (pass false to disable it entirely)
        ->authorize(fn (): bool => auth()->user()?->hasRole('super_admin') ?? false)
        // override the `developer_gate` config for this panel
        ->developerGate(true)
        // override the `local` config for this panel
        ->onlyLocal(false)
)

return [
    // route middleware applied to the page, the developer gate is appended when enabled
    'middlewares' => ['web', 'auth'],

    // only allow the page when APP_ENV=local
    'local' => true,

    // protect the page with the developer gate password
    'developer_gate' => true,

    // command => Gate ability(ies)
    'permissions' => [],

    // group => [commands], the whitelist of commands the page can run
    'commands' => [
        // ...
    ],

    'navigation' => [
        // hide the navigation item when the page is not accessible
        'show-only-commands-showing' => true,
        'group' => 'Settings',
        'icon' => 'heroicon-o-command-line',
    ],

    // defer the table filters and the column manager
    'defer' => [
        'filters' => false,
        'columns' => false,
    ],
];
bash
php artisan vendor:publish --tag="filament-artisan-config"
bash
php artisan optimize:clear
bash
php artisan vendor:publish --tag="filament-artisan-config"
bash
php artisan vendor:publish --tag="filament-artisan-views"
bash
php artisan vendor:publish --tag="filament-artisan-lang"