Closed sergejostir closed 3 years ago
Laravel 7.29.3
Sofa\Eloquence\Builder
>>> App\Models\User::where('name', '=', 'John')->where(function ($query) { $query->where('votes', '>', 100) ->orWhere('title', '=', 'Admin'); })->toSql(); => "select * from `users` where `name` = ? and (select * where `votes` > ? or `title` = ?) is null"
Illuminate\Database\Eloquent\Builder
>>> App\Models\User::where('name', '=', 'John')->where(function ($query) { $query->where('votes', '>', 100) ->orWhere('title', '=', 'Admin'); })->toSql(); => "select * from `users` where `name` = ? and (`votes` > ? or `title` = ?)"
As you can see, when Eloquence is used, it starts a subquery instead of a parameter group.
Is this related to #31 ?
It appears so. Closing this one as is a duplicate.
Laravel 7.29.3
Sofa\Eloquence\Builder
Illuminate\Database\Eloquent\Builder
As you can see, when Eloquence is used, it starts a subquery instead of a parameter group.