I am building a image upload in Laravel but I keep getting an error inside my foreach loop if one filed is empty.
My upload allows multible images[], so if one field is empty I get an error but I want to allow users to choose if they want to upload eg 2 or 5 images
$input = Input::all();
//Validation
File::exists($path) or File::makeDirectory($path);
foreach($input['images'] as $file) {
$image = Image::make($file->getRealPath()); //getRealPath gives me an error if not all images[] fields from post data containts an image
}
So how can I sort my input images[] from empty inputs?
Thanks in advance,