2
左のジョインにwhere句を追加すると、where句が右のテーブルで動作していますが、右のテーブルに一致する左のテーブルから結果が得られます。Laravel左結合where節を右のテーブルに追加する
$notifications = \DB::table('notifications')
->select(\DB::raw("notifications.uuid ,images.local_path as title_image"))
->leftJoin('images','images.owner_uuid', '=' ,'notifications.uuid')
where('images.relation','=','notification_title') ;
この問題は発生しませんが、このwhere句を左側の結合に追加するにはどうすればよいですか。
where('images.relation','=','notification_title') ;
「leftJoin」の前に 'where'節を追加する – hjpotter92