Started work on enabling/disabling components

This commit is contained in:
James Brooks
2015-11-03 21:32:45 +00:00
parent e8a3e18d55
commit edd111451e
10 changed files with 122 additions and 14 deletions

View File

@@ -26,14 +26,18 @@ class AddComponentCommandHandler
*/
public function handle(AddComponentCommand $command)
{
$component = Component::create(array_filter([
$componentData = array_filter([
'name' => $command->name,
'description' => $command->description,
'link' => $command->link,
'status' => $command->status,
'order' => $command->order,
'group_id' => $command->group_id,
]));
]);
$componentData['enabled'] = $command->enabled;
$component = Component::create($componentData);
event(new ComponentWasAddedEvent($component));