excuse me, i'm a junior developer and im still learn about laravel gates concept. i have a tables structure like this.
-
Users = id, email, password, role_id.
-
role = id, name, description.
-
permission = id, name, slug.
-
role_permission = permission_id, role_id. and this is my code
$permission = Permission::all();
foreach($permission as $p){ Gate::define($p->slug, function(User $user) use ($p) { return $user->role_id === ???; }); }
what should i return to protect gates, thanks.
im still learning about laravel gates concept, so i hope the other senior developers help me to explain about gates
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire