public function uploadImagePost(UploadUserImageRequest $request) { $user = Auth::user(); $image = $request->file('profile_image'); $destinationPath = 'uploads/users/'; $relativePath = implode('/', str_split(strtolower(str_random(3)))) . '/'; $image->move($destinationPath . $relativePath, $image->getClientOriginalName()); $user->update(['image_path' => $relativePath . $image->getClientOriginalName()]); return redirect()->route('my-account.home')->with('notificationText', 'User Profile Image Uploaded successfully!!'); }