Answer the question
In order to leave comments, you need to log in
How to exclude an array from an array?
There is an array of data
[
['id'=>1,
'title'=>'Первый'],
['id'=>2,
'title'=>'Второй']
];
Answer the question
In order to leave comments, you need to log in
I think something like this:
$filtered = Arr::where($array, function ($value, $key) {
return $value['id'] !==2 ;
});
And here where? This is not a stream for you in Java, this is an elementary and very shitty implementation for some reason. where won't help you.
https://laravel.com/docs/5.8/collections#method-filter
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question