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 resultsQuery result: SELECT * FROM `users` LEFT JOIN `follower` AS `uf2` ON `uf1`.`follower_id` = `uf2`.`followed_id` WHERE `uf2`.`follower_id` = ? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
->left_join('follower as uf2', function($join) {
$join->on('uf1.follower_id', '=', 'uf2.followed_id')
->where('uf2.follower_id', '=', Session::get('user_id'));
})
All reactions