Shield does not generate mine resources

What are the reasons why shield is not allowing me to see the resources even i am logged and i have a role super_admin(that have all the permissions i look into table role_has_permissions it has) i have enable register_role_policy in the filament-shield.php config directory and i added to user model traits HasRoles, HasPanelShield and the interface FilamentUser and the function canAccessPanel. Mine code of setting users role(seeder) is
public function run(): void
{
$users = $this->getUsers();

foreach($users as $user){
$user->assignRole('super_admin');
}
}
public function run(): void
{
$users = $this->getUsers();

foreach($users as $user){
$user->assignRole('super_admin');
}
}
filament-shield config for the admin is
'super_admin' => [
'enabled' => true,
'name' => 'super_admin',
'define_via_gate' => false,
'intercept_gate' => 'before', // after
],
'super_admin' => [
'enabled' => true,
'name' => 'super_admin',
'define_via_gate' => false,
'intercept_gate' => 'before', // after
],
Solution:
Thanks i solved mine problem the problem is that before seeder i have to start the command
php artisan shield:generate --all
php artisan shield:generate --all
Jump to solution
2 Replies
toeknee
toeknee4mo ago
#bezhansalleh-shield
Solution
mile4841
mile48414mo ago
Thanks i solved mine problem the problem is that before seeder i have to start the command
php artisan shield:generate --all
php artisan shield:generate --all
Want results from more Discord servers?
Add your server