Advertisement
IsraSimm

Laravel join query builder

Mar 2nd, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.23 KB | None | 0 0
  1. $posts = DB::table('posts as p')
  2.     ->join('users as u', function($join){
  3.         $join->on('u.id', '=', 'p.user_id');
  4.     })
  5.     ->join('categories as c', function($join){
  6.         $join->on('c.id', '=', 'p.category_id');
  7.     })->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement