Ejemplo n.º 1
0
 public function update(Specialty $specialty, validationRequest $request)
 {
     $specialty->name = $request->input('name');
     $specialty->code = $request->input('code');
     $specialty->save();
     return redirect()->route('as.specialties.index')->with('success', trans('academystructure::specialties.update_success'));
 }
Ejemplo n.º 2
0
 /**
  * [update description]
  * @param  Faculty           $faculty [description]
  * @param  validationRequest $request [description]
  * @return [type]                     [description]
  */
 public function update(Faculty $faculty, validationRequest $request)
 {
     $faculty->name = $request->input('name');
     $faculty->active = $request->has('active');
     if ($faculty->save()) {
         if ($faculty->active) {
             Faculty::where('id', '!=', $faculty->id)->update(['active' => 0]);
         }
     }
     return redirect()->route('as.faculties.index')->with('success', trans('academystructure::faculties.update_success'));
 }