Laravel multiple table join query with Query Builder.


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();

Laravel multiple table join query with Query Builder. Laravel multiple table join query with Query Builder. Reviewed by TechTubeHQ on April 11, 2022 Rating: 5

No comments:

Powered by Blogger.