I have the following columns in my games table:
-match_type
-team_one_id
-team_two_id
The match_type column can have either a value of singles or doubles. I have two additional tables called users and pairs.
If the value of match_type is singles, I would like the team_one_id and team_two_id columns to relate to the users table. If the value of match_type is doubles, I would like the two columns to relate to the pairs table.
How would I do this with Eloquent - where the relationships for two columns depend on the value of a type?
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2nxcW38
via IFTTT
Aucun commentaire:
Enregistrer un commentaire