php - Laravel/Entrust - Get Roles For Permission -
i'm trying figure out how permissions role laravel , entrust. uses pivot table called permission_role
has role_id
, permission_id
stored in it.
what i'm trying role it's id , permissions associated role. think may on complicating it, since have had 0 luck on hoping me out.
you may try this:
// hope have this: class role extends entrustrole {}
then permissions role id
1
:
$role = role::with('perms')->find(1); // assumed 1 role id dd($role->perms); // permissions in role
Comments
Post a Comment