You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When use the orWhere function with the array params, the result will be 'and'.
Steps To Reproduce:
$conditions = [['name', 'like', 'a%'], ['name', 'like', 'b%']];
User::orWhere($conditions)->toSql();
// should be: select * from users where (name like 'a%' or name like 'b%') and ...
// now: select * from users where (name like 'a%' and name like 'b%') and ...
I think it's best to use the suggestion from #24755 (comment) for now and post an issue at the laravel/ideas repo if you want this behavior to be changed.
Description:
When use the orWhere function with the array params, the result will be 'and'.
Steps To Reproduce:
$conditions = [['name', 'like', 'a%'], ['name', 'like', 'b%']];
User::orWhere($conditions)->toSql();
// should be: select * from
users
where (name
like 'a%' orname
like 'b%') and ...// now: select * from
users
where (name
like 'a%' andname
like 'b%') and ...Details
File: Illuminate\Database\Query\Builder.php
Line: 658-669
I think the $value[3] should be equal to $boolean if the array condition size is 3.
The text was updated successfully, but these errors were encountered: