Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I receive an id of a Role and with that id I list all the permissions that are assigned to that role

Good Evening, it is possible that in SPATIE-LARAVEL-PERMISSION the following:

Some function or way that I receive an id of a Role and with that id I list all the permissions that are assigned to that role. I’m looking but I didn’t find an answer. sorry for the inconvenience thank you

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

As described here in the docs, you can get all permissions of a role with the permissions relation

use \Spatie\Permission\Models\Role;

Role::find($id)->permissions;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading