Filter component elements that aren't set

This commit is contained in:
James Brooks
2015-10-17 09:59:43 +01:00
parent 654c0265aa
commit 49e4113159
2 changed files with 8 additions and 20 deletions

View File

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