I'm trying to implement the following package to handle user roles:
What I can't seem to figure out is where to define the roles themselves (the User model maybe?).
In the README, there's this explanation:
use Bican\Roles\Models\Role;
$adminRole = Role::create([
'name' => 'Admin',
'slug' => 'admin',
'description' => '', // optional
'level' => 1, // optional, set to 1 by default
]);
$moderatorRole = Role::create([
'name' => 'Forum Moderator',
'slug' => 'forum.moderator',
]);
But it doesn't really say where this snippet should be placed. Even when i tried to execute these code snippet in db nothing is happened.
please help me on this
Thanks.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire