Exemplo n.º 1
0
 /**
  * Update the specified holiday in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $holiday = Holiday::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Holiday::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     Holiday::updateHoliday($data, $id);
     return Redirect::route('holidays.index');
 }
Exemplo n.º 2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $holidays = Holiday::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Holiday::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $holidays->holidays_name = Input::get('holidays_name');
     $holidays->holidays_date = Input::get('holidays_date');
     $holidays->update();
     return Redirect::route('holidays.index');
 }