Aug 1, 2019
0
Level 3
Adding to team_users relationship
I have created a new Laravel Spark app with the --team-billing flag. This has created a users table, teams table and team_users table. All is well with this many-to-many relationship between teams and users. (https://spark.laravel.com/docs/8.0/teams)
I need to create a parent model. A parent can have many teams, but a team can only have one parent. I understand this is a one-to-many relationship.
I have also opted to create additional roles: owner, admin, member (https://spark.laravel.com/docs/8.0/teams#team-roles)
I have four questions:
- How can I create a relationship wherein the
userinherits theparentvia itsteam? - How can I limit a
userwith amemberrole to see data only for itsteam? - How can I allow a
userwith anadminrole to see all data of allteamswithin itsparent? - How can I allow a
userwith anownerrole to see all data of allparentsteams?
Please or to participate in this conversation.