Reputation: 1590
I have a Email model with the table 'messages' that contains all the message data.
I also have a pivot table 'message_users'.
How could I return all the messages that a user is associated with?
Upvotes: 0
Views: 36
Reputation: 1590
It was a simple question of adding the relationship to the Users model as well so now I can call: $user->emails;
to retrieve the emails associated with that user.
Upvotes: 1