PHP code example of syriable / filament-utilities

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

    

syriable / filament-utilities example snippets


use Filament\Panel;
use Syriable\Filament\Plugins\Utilities\UtilitiesPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            UtilitiesPlugin::make(),
        ]);
}

use Modules\Users\Filament\Resources\Admins\AdminResource;
use Syriable\Filament\Plugins\Utilities\Filament\Resources\Roles\RoleResource;

return [
    'shield' => [
        'resources' => [
            // Resources hidden from the permission matrix for the 'web' guard.
            'exclude' => [
                RoleResource::class,
                AdminResource::class,
            ],
        ],
        'policies' => [
            // Policy methods available in the permission matrix for the 'web' guard.
            'methods' => ['viewAny', 'view', 'create', 'update'],
        ],
    ],
    // ...
];

return [
    'shield' => [
        'resources' => [
            'exclude' => [
                // Resource classes omitted from the 'web' guard permission matrix.
            ],
        ],
        'policies' => [
            'methods' => ['viewAny', 'view', 'create', 'update'],
        ],
    ],
    'translator' => [
        // Scaffold missing translation keys while resolving labels.
        'create_missing_translation_keys' => true,

        // Map namespaces to translation path aliases.
        'path_aliases' => [
            'App\\Livewire' => 'livewire',
            'Modules\\Users\\Filament\\Resources' => 'modules/users',
        ],
    ],
];

use Syriable\Filament\Plugins\Utilities\UtilitiesServiceProvider;

public function boot(): void
{
    UtilitiesServiceProvider::initializeFilamentComponents();
    UtilitiesServiceProvider::microFilamentComponents();
    UtilitiesServiceProvider::configureFactoryIcons();
    UtilitiesServiceProvider::configureActivitylogTimeline();
}
bash
php artisan syriable:make-resource Buyer --panel=dashboard
bash
php artisan plugin:resource users

modules/users/src/UsersPlugin.php
bash
php artisan vendor:publish --tag=filament-utilities-config
bash
php artisan vendor:publish --tag=filament-utilities-stubs
bash
php artisan vendor:publish --tag=filament-utilities-config
bash
composer analyse   # PHPStan (512M memory limit)
composer lint      # Laravel Pint