Having three tables:
- Teams
- Users
- Badges
A User can belong to many Teams, and Badges can be assigned for every User-Team.
Options i thought until now:
- Create table "badges" with team_id and user_id as foreign.
- Create pivot table "badge_team_user" and assign the 3 foreigns.
And which would be the best way to query the results?
- $user->badges(team_id)
- $team->badges(user_id)
- $badges->printBadges(team_id, user_id)
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2LgyICv
via IFTTT
Aucun commentaire:
Enregistrer un commentaire