Example #1
0
 /**
  * Process a form to edit an existing talk.
  *
  * @param integer $id The id of the talk to edit.
  *
  * @return mixed The response.
  */
 public function processEditTalk($id)
 {
     try {
         // Get inputs.
         $talk = new Talk();
         $talk->number = Input::get('number');
         $talk->subject = Input::get('subject');
         $talk->locale_id = Input::get('locale_id');
         // Update talk.
         TalkService::updateTalk($id, $talk);
         $this->success(trans('messages.talkUpdated'));
         return Redirect::route('talks.list');
     } catch (ValidationException $e) {
         return Redirect::route('talks.edit', compact('id'))->withInput(Input::all())->withErrors($e->getValidator());
     } catch (Exception $e) {
         return $this->unexpected($e);
     }
 }