Example #1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  CompanyRequest $request
  * @param  int            $id
  * @return \Illuminate\Http\Response
  */
 public function update(CompanyRequest $request, $id)
 {
     $data = $request->all();
     $obj = $this->repository->find($id);
     $this->repository->update($data, $obj);
     return redirect()->route('admin.company.index');
 }
Example #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  CompanyRequest $request
  * @param  int            $id
  * @return \Illuminate\Http\Response
  */
 public function update(CompanyRequest $request, $id)
 {
     $company = $this->companies->findOrFail($id);
     $company->update($request->all());
     if ($request->hasFile('image')) {
         $company->addImage($request->file('image'), 'education', $company->id . '-company.png');
     }
     flash()->success('Updated!', 'Company has been updated!');
     return redirect()->route('admin.company.index');
 }