shujau

Need a solution for a relationship in Models

Posted 3 years ago by shujau

Ok.. a have three tables . . two main tables and one pivot table,, users, notification_user, notifications..

users can have many notifications and each notification belongs to many users this relation is simple to understand and do in models.

Problem is the next one...

user who sends the notification... his id should also appear in the notification table..

a user can send many messages, each message is sent by one user.... how do u show this relation in model user and notification model. do i just add another one to many relation to the same 2 tables?

sorry if this is confusing.. im very new here. someone help....

Please sign in or create an account to participate in this conversation.