Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jooorooo's avatar

Error with Eloquent query builder 5.7

When i make query at this type:

$record = Product::selectRaw('id < ?', [552])
            ->where('id', 0)
            ->select('id');

query builder make this query:

select `id` from `products` where `id` = '552'

not:

select `id` from `products` where `id` = '0'

Used laravel 5.7

0 likes
2 replies
jooorooo's avatar

Ok. This query is ok. But the problem is not in get method. Problem is in select method where not reset select bindings and must be reset manualy.

Please or to participate in this conversation.