在map函数中,我想使用dd();dump,但是我只得到第一个对象。当我使用print_r();在一个映射函数中,我会得到所有的对象
$valeurCategorieCible = $CategoriesItineraires->map(function ($item) {
return $item->ciblesParCategorie->map(function ($ciblesParCategorie) {
return $ciblesParCategorie->cibles->map(function ($items) {
print_r($items); // Return all objects
dd($items); // Return only the first object then stop !
});
});
});
https://stackoverflow.com/questions/72025622
复制相似问题