1 year ago
#358225
Zsolti
If Laravel collection has more than 1000 items the hasMany relationship collections are dissapearing
I have a Laravel query:
$var = Model::with(['rel1','rel2.1','rel2.2','rel2.3','rel3','rel4'])
->whereBetween('datum', [$start, $end])
->get();
If $var
has more than 1000 items the hasMany relationships return an empty collection.
If the same query has less than 1000 items the relationships are fine.
I have tried to set the PHP ini settings:
ini_set('memory_limit', '512M');
ini_set('max_input_vars', 30000);
ini_set('max_execution_time', 380);
But nothing worked so far.
On localhost everything works as expected, this issue only apears on the web server. Laravel is 5.4, PHP version 7.2.24
I'd like to get the relationships even if the collection is largen than 1000.
Thanks for your help.
php
laravel
laravel-5
laravel-collection
0 Answers
Your Answer