[Solved] how to upload a pdf document in Laravel


I have already uploaded a file with its name. If you want to specific name will be file name, then change $file->storeAs($filePath, $fileName="RESUME", 'uploads');.If you have any queries, feel free to comment below. Thanks

protected function create(array $data){
 $request = request();

 $profileImage = $request->file('resumes');
 $profileImageSaveAsName = time() . Auth::id() . "-profile." . $profileImage->getClientOriginalExtension();

 $upload_path="resumes/";
 $resumes= $upload_path . $profileImageSaveAsName;
 $success = $profileImage->move($upload_path, $profileImageSaveAsName);


  return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => bcrypt($data['password']),
        'dob' => $data['dob'],
        'resumes' => $resumes,
    ]);
}

3

solved how to upload a pdf document in Laravel