/** * 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'); }
/** * 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'); }