Answer the question
In order to leave comments, you need to log in
Laravel chunk with condition not working?
There are tables entities and urls, relation oneToMany.
This code doesn't output anything
Entity::where('id', 89)->whereNotExists(function($query) {
$query->from('urls')->where('url', 'like', '%itunes%');
})->get();
Entity::where('id', 89)->whereNotExists(function($query) {
$query->from('urls')->where('url', 'like', '%itunes%');
})->chunk(200, function($entities) {
dd($entities->toArray());
});
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