Answer the question
In order to leave comments, you need to log in
Why doesn't the where method of Laravel collections support all PHP statements?
$collection = collect([
['product' => '1', 'price' => 1],
['product' => '2', 'price' => 2],
['product' => '3 ', 'price' => 3],
]);
print $collection->where('price', '&', 1)->pluck('product')->implode(', ');
Prints 1 instead of 1.3.
It would be logical to have all the operators here https://github.com/laravel/framework/blob/c6cf3813...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question