lundi 25 décembre 2017

Laravel hasManyThrough 2 tables

i have two tables as below: users table: |id|name|email|password|created_at|updated_at

messages table: |id|sender_id|receiver_id|message|created_at|updated_at

User model:

public function threads() { return $this->hasManyThrough(Message::class, User::class,'id','sender_id'); }

i'm trying retrieve message threads which isn't working. any help appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire