Install Filament Shield
composer require bezhansalleh/filament-shield
php artisan vendor:publish --tag="filament-shield-config"
Set Filament Shield config file /config/filament-shield.php
'auth_provider_model' => 'App\\Models\\User',
Set user model app/Models/User.php
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticable
{
use HasRoles;
}
Run setup
php artisan shield:setup
# multi-tenancy
php artisan shield:setup --tenant=App\\Models\\Team
Install Shield to Filament panel
php artisan shield:install admin --tenant --generate-relationships
# Replace 'admin' with your panel ID
Top comments (0)