コード例 #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  ProfileRequest $request
  * @return \Illuminate\Http\Response
  */
 public function update(ProfileRequest $request)
 {
     $data = $request->all();
     $profile = $this->repository->first();
     $this->repository->update($data, $profile->id);
     return redirect()->route('admin.profile.index');
 }
コード例 #2
0
ファイル: ProfileController.php プロジェクト: CbCaio/pwebdev
 /**
  * Update the specified resource in storage.
  *
  * @param  ProfileRequest $request
  * @return \Illuminate\Http\Response
  */
 public function update(ProfileRequest $request)
 {
     $data = $request->all();
     $profile = $this->profile;
     $profile->update($data);
     if ($request->hasFile('avatar')) {
         $profile->addImage($request->file('avatar'), 'default_routine', 'profile_avatar.png');
     }
     flash()->success('Updated!', 'Profile has been updated');
     return redirect()->route('admin.profile.index');
 }