/**
  * Update the specified resource in storage.
  * PUT /approval/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     try {
         $this->approvalForm->validate(Input::all());
     } catch (FormValidationException $error) {
         return Redirect::back()->withInput()->withErrors($error->getErrors());
     }
     $decisionOptions = Input::get('decisionOptions');
     $formRejectReasons = Input::get('formRejectReasons');
     $approver = Input::get('approver');
     $approval = $this->execute(new ApproveRequestCommand($id, $decisionOptions, $formRejectReasons, $approver));
     if ($approval) {
         $formNum = $this->onlineFormRepo->getFormNum($id);
         $viewRequest = '<a href="' . URL::route('rfps.show', $formNum) . '">View Request here.' . '</a>';
         $msg = '';
         if ($decisionOptions == 0) {
             $msg = 'Request approved! ' . $viewRequest;
             Flash::success($msg);
         } else {
             $msg = 'Request rejected! ' . $viewRequest;
             Flash::success($msg);
         }
     } else {
         Flash::error('Failed to make a decision');
     }
     return Redirect::route('approval.edit', $id);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $this->approvalForm->validate(Input::all());
     $decisionOptions = Input::get('decisionOptions');
     $formRejectReasons = Input::get('formRejectReasons');
     $receiver = Input::get('receiver');
     $receiving = $this->execute(new ApproveReceiveRequestCommand($id, $decisionOptions, $formRejectReasons, $receiver));
     if ($receiving) {
         $formNum = $this->onlineFormRepo->getFormNum($id);
         $viewRequest = '<a href="' . URL::route('rfps.show', $formNum) . '">View Request here.' . '</a>';
         $msg = '';
         if ($decisionOptions == 0) {
             $msg = 'Request approved! ' . $viewRequest;
             Flash::success($msg);
         } else {
             $msg = 'Request rejected! ' . $viewRequest;
             Flash::success($msg);
         }
     } else {
         Flash::error('Failed to make a decision');
     }
     return Redirect::route('receiving.edit', $id);
 }