コード例 #1
0
 /**
  * Get request from profile form and update the fields of the Customer instance.
  * Then redirect to their intended location or '/'
  *
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function profileUpdate(UpdateProfileRequest $request)
 {
     // Retrieve all data in $request to an array
     $data = $request->all();
     // Find and retrieve the appropriate Customer instance
     $customer = Customer::where('email', Auth::user()->email)->first();
     // Update the details
     $customer->name = $data['name'];
     $customer->NIC_passport_num = $data['ID'];
     $customer->telephone_num = $data['telephone'];
     $customer->address_line_1 = $data['address_line1'];
     $customer->address_line_2 = $data['address_line2'];
     $customer->city = $data['city'];
     $customer->province_state = $data['province'];
     $customer->zip_code = $data['zipCode'];
     $customer->country = $data['country'];
     // Save the updated Customer instance
     $customer->save();
     //this lines are added, if the user is facebook logged in user he needs to fill his other details and he should be
     //redirected to payment page, since return redirect()->intended() is not working for this purpose
     if (Session::has('fblogin_payment')) {
         return redirect('payment');
     }
     return redirect()->intended('/')->with('success', 'Your details have been updated successfully.');
 }
コード例 #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(UpdateProfileRequest $request)
 {
     $user = Auth::user();
     $user->fill($request->all());
     $user->password = bcrypt($request->input('password'));
     $user->save();
     return redirect()->route('home')->with('status.success', "Your profile has been updated.");
 }
コード例 #3
0
 public function update(Requests\UpdateProfileRequest $request)
 {
     $user = User::findOrFail(Auth::user()->id);
     $new_password = Input::get('new_password');
     if ($new_password != '') {
         $request->offsetSet('password', bcrypt($new_password));
     }
     $user->status = 'ACTIVE';
     $date = new \DateTime();
     $user->active_date = $date;
     $user->update($request->all());
     $message = 'You have successfully updated your Profile';
     return view('myProfile.show', compact('user', 'message'));
 }
コード例 #4
0
 /**
  * @param UpdateProfileRequest $request
  * @param $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function update(UpdateProfileRequest $request, $id)
 {
     $user = $this->user->find($id);
     $user->update($request->all());
     $username = str_replace(' ', '-', $user->username);
     Session::flash('message', 'You have successfully updated your profile!');
     if ($request->file('image')) {
         try {
             $img = ImageLib::addImage($request->file('image'), $username, $user->id);
         } catch (QueryException $e) {
             Session::flash('message', 'There were some problems with your image.');
         }
     }
     return redirect()->route('profile.show', $username);
 }
コード例 #5
0
 public function update(UpdateProfileRequest $request)
 {
     $user = auth()->user();
     if ($request->get('new_password', false)) {
         if (!\Hash::check($request->password, auth()->user()->password)) {
             flash()->error(t('profile.flash.incorrect_password'));
             return back()->withInput();
         }
         $user->password = bcrypt($request->get('new_password'));
     }
     $user->phone = $request->get('phone');
     $user->name = $request->get('name');
     $user->save();
     flash()->success(t('profile.flash.updated'));
     return back();
 }
コード例 #6
0
ファイル: BackController.php プロジェクト: soywod/helene
 /**
  * Admin profile update action.
  *
  * @param \App\Http\Requests\UpdateProfileRequest $request the incoming request
  * @return \Illuminate\Http\RedirectResponse the redirect response
  */
 public function postProfile(UpdateProfileRequest $request) : RedirectResponse
 {
     // Init params and current user
     $params = $request->all();
     $user = Auth::user();
     // Update user's email, desc and thumbnail
     $user->update($params);
     // If new password entered, update user's password
     if (!empty($params['password'])) {
         $user->password = Hash::make($params['password']);
     }
     // Save user
     $user->save();
     // Return back with success message
     return back()->with('message', ucfirst(trans('back/profile.success_updated')));
 }
コード例 #7
0
 /**
  * Update the specified Profile in storage.
  *
  * @param  int              $id
  * @param UpdateProfileRequest $request
  *
  * @return Response
  */
 public function update($id, UpdateProfileRequest $request)
 {
     $profile = $this->profileRepository->find($id);
     if (empty($profile)) {
         Flash::error('Profile not found');
         return redirect(route('profiles.index'));
     }
     $profile = $this->profileRepository->updateRich($request->all(), $id);
     Flash::success('Profile updated successfully.');
     return redirect(route('profiles.index'));
 }
コード例 #8
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(UpdateProfileRequest $request, $id)
 {
     $this->userRepository->updateProfile($request->all());
     Session::flash('message', 'Profile successfully updated!');
     return Redirect::back();
 }
コード例 #9
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  int                      $id
  *
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\UpdateProfileRequest $request, User $user)
 {
     $this->authorize('edit-profile');
     if ($request->hasFile('file')) {
         $profilePic = $request->file('file');
         $id = md5($profilePic);
         $profilePic->move(public_path('/img/pp/'), $id);
         if (file_exists(public_path('img/pp/' . $user->picture_id))) {
             unlink(public_path('img/pp/' . $user->picture_id));
         }
         $user->picture_id = $id;
     }
     foreach ($request->only(['name', 'email']) as $key => $value) {
         $user->{$key} = $value;
     }
     $user->save();
     return redirect()->back();
 }
コード例 #10
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(UpdateProfileRequest $request, $id)
 {
     /** @var Profile $profile */
     $profile = Profile::findOrFail($id);
     $profile->update($request->all());
     flash()->success('Success!', 'Profile has been updated.');
     return redirect()->route('profiles.show', ['profiles' => $id]);
 }
コード例 #11
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(UpdateProfileRequest $request)
 {
     //$user = User::where('id', $id)->first();
     Auth::user()->update($request->all());
     return redirect()->route('user.edit')->with('info', 'Your profile has been updated');
 }
コード例 #12
0
 public function store(UpdateProfileRequest $request)
 {
     $this->currentUser->update($request->only(['name', 'email']));
     flash()->success('Your account has been updated!');
     return back();
 }