why i cannot use where on join clousure ? #34
Replies: 1 comment 1 reply
-
@wznuhidayat Hi, correct. The join's DB::table('users')->left_join('follower as uf2', function ($join) {
$join->on('uf1.follower_id', '=', 'uf2.followed_id');
})
->where('uf2.follower_id', '=', Session::get('user_id'))
->select()
->to_sql(); // Use ->get() to retrieve the results Query result: SELECT * FROM `users` LEFT JOIN `follower` AS `uf2` ON `uf1`.`follower_id` = `uf2`.`followed_id` WHERE `uf2`.`follower_id` = ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
->left_join('follower as uf2', function($join) {
$join->on('uf1.follower_id', '=', 'uf2.followed_id')
->where('uf2.follower_id', '=', Session::get('user_id'));
})
Beta Was this translation helpful? Give feedback.
All reactions