I have 2 database tables:
user
id
| name
,
message
id
| sender_id
| receiver_id
.
How can I generate custom view and get data by sender_id
and receiver_id
? I mean when user log in he will see his inbox and outbox messages. Please explain the logic of this. I also will be glad if you will provide code examples because I am newbie in php and yii2. If something is not understandable I will explain more specifically.