I have stuck in a silly silly sample of code but i can't find solution. I have this code:
Route::get('/example', function(){
$arr=[];
Collection::all()->each(function($collection){
$arr[]= $collection->id;
});
dd($arr);
});
and it returns to me an empty array all the time despite the fact that Collection:all() has objects inside. Can someone help me?