I want to optimize this short loop in php – Laravel
this code is working but is there a better way for it to make it shorter if ($request->has('images')) { $images = []; foreach ($data['images'] as $image) { $images[] = UploadImage::uploadImageToStorage($image, 'Feeds/store/' . $data['store_id']); } $data['images'] = $images; }