-
Hello, I am developing my first Laravel app. I am using // Reset cached roles and permissions
app()[PermissionRegistrar::class]->forgetCachedPermissions();
// create permissions
Permission::create(['name' => 'view-organizations']);
$role2 = Role::create(['name' => 'professional']);
$role2->syncPermissions([
'view-organizations',
]);
I have followed it to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I hate finding the solution after hours searching and asking for help. But here it is. I am using |
Beta Was this translation helpful? Give feedback.
I hate finding the solution after hours searching and asking for help.
But here it is. I am using
WithoutModelEvents
trait in mySeeder
, so I need to callapp()[PermissionRegistrar::class]->forgetCachedPermissions()
after permissions are seeded as per #2342 (comment)