I wan't to change my form to enable more than one image to be uploaded at a time, this is what I currently have,
part of my form:
{!! Form::open(['action' => 'PostsController@store', 'method' => 'POST', 'enctype' => 'multipart/form-data']) !!}
{{Form::file('stock_image')}}
my controller:
if($request->hasFile('stock_image')){
$filenameWithExt = $request->file('stock_image')->getClientOriginalName();
$filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);
$extension = $request->file('stock_image')->getClientOriginalExtension();
$fileNameToStore= $filename.'_'.time().'.'.$extension;
$path = $request->file('stock_image')->storeAs('public/images', $fileNameToStore);
} else {
$fileNameToStore = 'noimage.jpg';
}
thanks for your help!