original_string: public function createIncidentUpdateAction(Incident $incident)
      {
          try {
              $incidentUpdate = execute(new CreateIncidentUpdateCommand(
                  $incident,
                  Binput::get('status'),
                  Binput::get('message'),
                  Binput::get('component_id'),
                  Binput::get('component_status'),
                  $this->auth->user()
              ));
          } catch (ValidationException $e) {
              return cachet_redirect('dashboard.incidents.updates.create', ['id' => $incident->id])
                  ->withInput(Binput::all())
                  ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.updates.add.failure')))
                  ->withErrors($e->getMessageBag());
          }
  
          if ($incident->component) {
              $incident->component->update(['status' => Binput::get('component_status')]);
          }
  
          return cachet_redirect('dashboard.incidents')
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.updates.success')));
      }
code: public function createIncidentUpdateAction(Incident $incident)
      {
          try {
              $incidentUpdate = execute(new CreateIncidentUpdateCommand(
                  $incident,
                  Binput::get('status'),
                  Binput::get('message'),
                  Binput::get('component_id'),
                  Binput::get('component_status'),
                  $this->auth->user()
              ));
          } catch (ValidationException $e) {
              return cachet_redirect('dashboard.incidents.updates.create', ['id' => $incident->id])
                  ->withInput(Binput::all())
                  ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.updates.add.failure')))
                  ->withErrors($e->getMessageBag());
          }
  
          if ($incident->component) {
              $incident->component->update(['status' => Binput::get('component_status')]);
          }
  
          return cachet_redirect('dashboard.incidents')
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.updates.success')));
      }
code_tokens: public function createIncidentUpdateAction ( Incident $ incident ) { try { $ incidentUpdate = execute ( new CreateIncidentUpdateCommand ( $ incident , Binput :: get ( 'status' ) , Binput :: get ( 'message' ) , Binput :: get ( 'component_id' ) , Binput :: get ( 'component_status' ) , $ this -> auth -> user ( ) ) ) ; } catch ( ValidationException $ e ) { return cachet_redirect ( 'dashboard.incidents.updates.create' , [ 'id' => $ incident -> id ] ) -> withInput ( Binput :: all ( ) ) -> withTitle ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.whoops' ) , trans ( 'dashboard.incidents.updates.add.failure' ) ) ) -> withErrors ( $ e -> getMessageBag ( ) ) ; } if ( $ incident -> component ) { $ incident -> component -> update ( [ 'status' => Binput :: get ( 'component_status' ) ] ) ; } return cachet_redirect ( 'dashboard.incidents' ) -> withSuccess ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.awesome' ) , trans ( 'dashboard.incidents.updates.success' ) ) ) ; }
docstring: Creates a new incident update.
  
  @param \CachetHQ\Cachet\Models\Incident $incident
  
  @return \Illuminate\Http\RedirectResponse
docstring_tokens: Creates a new incident update .