component; $component->update($this->filterComponentData($command)); event(new ComponentWasUpdatedEvent($component)); return $component; } protected function filterComponentData($command) { return array_filter([ 'name' => $command->name, 'description' => $command->description, 'link' => $command->link, 'status' => $command->status, 'order' => $command->order, 'group_id' => $command->group_id, ]); } }