I have a search result from image
model and $photo
saved the data which $photo->type == 'photo'
.
$photo = $image->filter(function($photo,$key) use($path){
if($photo->type == 'photo'){
$photo->url = $path.$photo->image;
return $photo;
}
});
Here is the $photo
collection and is there any way to array_values()
the items
data?
Collection {#352 ▼
#items: array:3 [▼
2 => ImageBanquet {#349 ▶}
3 => ImageBanquet {#350 ▶}
4 => ImageBanquet {#351 ▶}
]
}
Check values()
collection helper.
$values = $collection->values();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With