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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -