original_string: public function editMetricAction(Metric $metric)
      {
          try {
              execute(new UpdateMetricCommand(
                  $metric,
                  Binput::get('name', null, false),
                  Binput::get('suffix', null, false),
                  Binput::get('description', null, false),
                  Binput::get('default_value', null, false),
                  Binput::get('calc_type', null, false),
                  Binput::get('display_chart', null, false),
                  Binput::get('places', null, false),
                  Binput::get('default_view', null, false),
                  Binput::get('threshold', null, false),
                  null,
                  Binput::get('visible', null, false)
              ));
          } catch (ValidationException $e) {
              return cachet_redirect('dashboard.metrics.edit', [$metric->id])
                  ->withInput(Binput::all())
                  ->withTitle(sprintf('<strong>%s</strong>', trans('dashboard.notifications.whoops')))
                  ->withErrors($e->getMessageBag());
          }
  
          return cachet_redirect('dashboard.metrics.edit', [$metric->id])
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.edit.success')));
      }
code: public function editMetricAction(Metric $metric)
      {
          try {
              execute(new UpdateMetricCommand(
                  $metric,
                  Binput::get('name', null, false),
                  Binput::get('suffix', null, false),
                  Binput::get('description', null, false),
                  Binput::get('default_value', null, false),
                  Binput::get('calc_type', null, false),
                  Binput::get('display_chart', null, false),
                  Binput::get('places', null, false),
                  Binput::get('default_view', null, false),
                  Binput::get('threshold', null, false),
                  null,
                  Binput::get('visible', null, false)
              ));
          } catch (ValidationException $e) {
              return cachet_redirect('dashboard.metrics.edit', [$metric->id])
                  ->withInput(Binput::all())
                  ->withTitle(sprintf('<strong>%s</strong>', trans('dashboard.notifications.whoops')))
                  ->withErrors($e->getMessageBag());
          }
  
          return cachet_redirect('dashboard.metrics.edit', [$metric->id])
              ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.metrics.edit.success')));
      }
code_tokens: public function editMetricAction ( Metric $ metric ) { try { execute ( new UpdateMetricCommand ( $ metric , Binput :: get ( 'name' , null , false ) , Binput :: get ( 'suffix' , null , false ) , Binput :: get ( 'description' , null , false ) , Binput :: get ( 'default_value' , null , false ) , Binput :: get ( 'calc_type' , null , false ) , Binput :: get ( 'display_chart' , null , false ) , Binput :: get ( 'places' , null , false ) , Binput :: get ( 'default_view' , null , false ) , Binput :: get ( 'threshold' , null , false ) , null , Binput :: get ( 'visible' , null , false ) ) ) ; } catch ( ValidationException $ e ) { return cachet_redirect ( 'dashboard.metrics.edit' , [ $ metric -> id ] ) -> withInput ( Binput :: all ( ) ) -> withTitle ( sprintf ( '<strong>%s</strong>' , trans ( 'dashboard.notifications.whoops' ) ) ) -> withErrors ( $ e -> getMessageBag ( ) ) ; } return cachet_redirect ( 'dashboard.metrics.edit' , [ $ metric -> id ] ) -> withSuccess ( sprintf ( '%s %s' , trans ( 'dashboard.notifications.awesome' ) , trans ( 'dashboard.metrics.edit.success' ) ) ) ; }
docstring: Edit an metric.
  
  @param \CachetHQ\Cachet\Models\Metric $metric
  
  @return \Illuminate\Http\RedirectResponse
docstring_tokens: Edit an metric .