Does this help?
http://laraveldaily.com/upload-multiple-files-laravel-5-4/
dd($request->file) before the foreach and post the result.
I'm here after a lot of search and I have not come to a fix yet.
I'm trying to upload several files but it's not getting pass the foreach loop.
/*
* Validator here. The 'file.*' indicates it's an array.
*/
$this->validate($request, [
'file' => 'required',
'file.*' => 'image|mimes:jpg,png|max:5000',
]);
if($request->hasFile('file')){
$images = $request->file('file');
//I have confirmed that the code doesn't enter the foorloop and the $images is not empty
foreach($images as $image){
$filename = time().'.'.$image->getClientOriginalExtension();
Image::make($image)->resize(300,300)->save(public_path('images/'.$filename));
}
}
$request->session()->flash('alert-success', 'House uploaded sucessully. After validation you will receive an email.');
return view('addHouse', array('user' => Auth::user()));
Does this help?
http://laraveldaily.com/upload-multiple-files-laravel-5-4/
dd($request->file) before the foreach and post the result.
Please or to participate in this conversation.