Answer the question
In order to leave comments, you need to log in
In which file to create roles (RBAC)?
I want to install RBAC in my project. I'm using this library https://github.com/DynamicCodeNinja/RBAC
But I can't figure out where and in what file should I create roles?
use DCN\RBAC\Models\Role;
$adminRole = Role::create([
'name' => 'Admin',
'slug' => 'admin',
'description' => '', // optional
'parent_id' => NULL, // optional, set to NULL by default
]);
$moderatorRole = Role::create([
'name' => 'Forum Moderator',
'slug' => 'forum.moderator',
]);
Answer the question
In order to leave comments, you need to log in
where and in what file should I create roles?
php artisan tinker
, there is no difference.
Better create a seed and pull it php artisan db:seed --class=RBACSeeder. Well, in general, all manipulations with the database through migrations and seeds.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question