Kmspico Download | Official KMS Activator Website [New Version 2024] Fast and Easy Converter YouTube to MP3 Online KMSAuto Net Activator Download 2024 Immediate Byte Pro Neoprofit AI Blacksprut without borders. Discover new shopping opportunities here where each link is an entrance to a world ruled by anonymity and freedom.

Join Multiple Table Query in Laravel

Friends, today I will tell you this through my article. How you can join Multiple tables through laravel.

Join multiple tables Using laravel 7, join multiple tables query in laravel 6, laravel 5.8 Use join query for multiple table, join multiple tables query in laravel 5.7, join multiple tables query in laravel 5.6 Or 5.5 Or 5.4 and 5.3, 5.2, 5.1

If you want to join multiple table by laravel query. Then you can join table very easily. How to join multiple table by laravel below. The query of join is given below.

$join = DB::table('shares')
->join('users', 'users.id', '=', 'shares.user_id')
->join('comments', 'comments.user_id', '=', 'users.id')
->get();

Join multile tables query use with WHERE Condition

$join = DB::table('shares')
->join('users', 'users.id', '=', 'shares.user_id')
->join('comments', 'comments.user_id', '=', 'users.id')
->where('comments.comment_id', '=', 10)
->get();

Join two tables query use with Limit Condition

$join = DB::table('shares')
->join('users', 'users.id', '=', 'shares.user_id')
->join('comments', 'comments.user_id', '=', 'users.id')
->where('comments.comment_id', '=', 10)
->limit(5)
->get();