owner
it's a column of bulletins
table which is relation in Conversations model.
public function bulletin()
{
return $this->belongsTo('App\Bulletins','bulletin_id');
}
$conversations = Conversations::with('bulletin','messages')
->where('owner_id', $userId)
->orWhere('owner', $userId)
->get();
I got unknown column owner. I know what it mean, but how to do this in laravel? Before I used left join for this request and now I want to use eloquent relations.