Tag syncing is now done within the Component commands
This commit is contained in:
@@ -53,6 +53,15 @@ class CreateComponentCommandHandler
|
||||
{
|
||||
$component = Component::create($this->filter($command));
|
||||
|
||||
// Sync the tags into the component.
|
||||
if ($command->tags) {
|
||||
collect(preg_split('/ ?, ?/', $command->tags))->filter()->map(function ($tag) {
|
||||
return trim($tag);
|
||||
})->pipe(function ($tags) use ($component) {
|
||||
$component->attachTags($tags);
|
||||
});
|
||||
}
|
||||
|
||||
event(new ComponentWasCreatedEvent($this->auth->user(), $component));
|
||||
|
||||
return $component;
|
||||
|
||||
Reference in New Issue
Block a user