if($request->has('image')){
$file = $request->image;
$originalName = $file->getClientOriginalName();
$fileName = explode('.', $originalName);
$fileName = $fileName[0].'_'.time().'.'.$fileName[1];
$path = public_path().'/upload';
if(!is_dir($path)){
$oldmark=umask(0);
mkdir($path,0777,true);
umask($oldmark);
}
$file->move($path,$fileName);
$url = '/upload/'.$fileName;
$event->image = $url;
}
This is the file storage code.
Please anyone solve this problem..I was trying but nothing happining.