/** * Update the specified resource in storage. * * @param EducationalExperienceRequest $request * @param int $id * @return \Illuminate\Http\Response */ public function update(EducationalExperienceRequest $request, $id) { $educational_experience = $this->educationalExperiences->where('id', $id)->first(); $educational_experience->update($request->all()); if ($request->hasFile('image')) { $educational_experience->addImage($request->file('image')); } flash()->success('Updated!', 'Educational Experience has been updated'); return redirect()->route('admin.educational_experience.index'); }
/** * Update the specified resource in storage. * * @param EducationalExperienceRequest $request * @param int $id * @return \Illuminate\Http\Response */ public function update(EducationalExperienceRequest $request, $id) { $data = $request->all(); $obj = $this->repository->find($id); $this->repository->update($data, $obj->id); return redirect()->route('admin.educational_experience.index'); }