original_string: public function createIncidentTemplateAction()
      {
          try {
              IncidentTemplate::create([
                  'name'     => Binput::get('name'),
                  'template' => Binput::get('template', null, false, false),
              ]);
          } catch (ValidationException $e) {
              return cachet_redirect('dashboard.templates.create')
                  ->withInput(Binput::all())
                  ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.add.failure')))
                  ->withErrors($e->getMessageBag());
          }
  
          return cachet_redirect('dashboard.templates')
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.add.success')));
      }
code: public function createIncidentTemplateAction()
      {
          try {
              IncidentTemplate::create([
                  'name'     => Binput::get('name'),
                  'template' => Binput::get('template', null, false, false),
              ]);
          } catch (ValidationException $e) {
              return cachet_redirect('dashboard.templates.create')
                  ->withInput(Binput::all())
                  ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.incidents.templates.add.failure')))
                  ->withErrors($e->getMessageBag());
          }
  
          return cachet_redirect('dashboard.templates')
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.incidents.templates.add.success')));
      }
code_tokens: public function createIncidentTemplateAction ( ) { try { IncidentTemplate :: create ( [ 'name' => Binput :: get ( 'name' ) , 'template' => Binput :: get ( 'template' , null , false , false ) , ] ) ; } catch ( ValidationException $ e ) { return cachet_redirect ( 'dashboard.templates.create' ) -> withInput ( Binput :: all ( ) ) -> withTitle ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.whoops' ) , trans ( 'dashboard.incidents.templates.add.failure' ) ) ) -> withErrors ( $ e -> getMessageBag ( ) ) ; } return cachet_redirect ( 'dashboard.templates' ) -> withSuccess ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.awesome' ) , trans ( 'dashboard.incidents.templates.add.success' ) ) ) ; }
docstring: Creates a new incident template.
  
  @return \Illuminate\Http\RedirectResponse
docstring_tokens: Creates a new incident template .