metric; $metric->update($this->filterMetricData($command)); event(new MetricWasUpdatedEvent($metric)); return $metric; } /** * Filter the command data. * * @param \CachetHQ\Cachet\Commands\Metric\UpdateMetricCommand $command * * @return array */ protected function filterMetricData($command) { return array_filter([ 'name' => $command->name, 'suffix' => $command->suffix, 'description' => $command->description, 'default_value' => $command->default_value, 'calc_type' => $command->calc_type, 'display_chart' => $command->display_chart, 'places' => $command->places, ]); } }