Laravel multiple table join query with Query Builder.
$posts = DB::table('posts')
->join('artists', 'posts.id', '=', 'artists.artist_id')
->join('releases', 'posts.id', '=', 'releases.release_id')
->select('posts.*', 'artists.title as artist_title', 'releases.title as release_title')
->get();
No comments: