Is there any more documentation on implementing teams? #1998
-
Hey I have followed your guides and have at least two models in my app. I have extended both of these with the HasRoles Trait that laravel-permissions provides. I have updated my permission.php to include account_id as the custom team_foreign_key I have created seeders the create users accounts and roles. The users accounts and roles are all seeded correctly and show up in the database.
accounts
account_user
roles
model_has_roles
I implemented some middleware and put it in the priority list although I'm not sure where it should be, should it be first or last? Should I add the other spatie permission classes to this priority list also? Everything looks like it's hooked up correctly following the Teams guide however when I do the following in my middleware:
The result is always null. If I set and get from a policy or from a controller. I checked the query for roles and it seems that the team isn't being applied. Have I missed something?
Shouldn't this be This part of the documentation https://spatie.be/docs/laravel-permission/v5/basic-usage/teams-permissions#working-with-teams-permissions was particularly confusing. I can't figure out what that sentence means. Any help is appreciated. Even some working examples would be nice to look at. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Version of package? |
Beta Was this translation helpful? Give feedback.
Version of package?
#1906 (reply in thread)