$fileName = null; if($request->hasFile('image')){ $photoFile = $request->file('image'); $fileName = $photoFile->getClientOriginalName(); Storage::putFileAs('public/photos',$photoFile, $fileName); }