validate([ 'file' => 'required|mimes:pdf|max:2048', ]); $fileName = time().'.'.$request->file->extension(); $request->file->move(public_path('uploads'), $fileName); return redirect()->route("process", ['fileName' => $fileName]); } }