Skip to content

Commit

Permalink
[fix] fix dispatch event create when create duplicate module
Browse files Browse the repository at this point in the history
  • Loading branch information
alissn committed Aug 15, 2024
1 parent 822ed10 commit 018fc88
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Generators/ModuleGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ public function generate(): int
{
$name = $this->getName();

Event::dispatch(sprintf('modules.%s.%s', strtolower($name), ModuleEvent::CREATING));

if ($this->module->has($name)) {
if ($this->force) {
$this->module->delete($name);
Expand All @@ -289,6 +287,9 @@ public function generate(): int
return E_ERROR;
}
}

Event::dispatch(sprintf('modules.%s.%s', strtolower($name), ModuleEvent::CREATING));

$this->component->info("Creating module: [$name]");

$this->generateFolders();
Expand Down

0 comments on commit 018fc88

Please sign in to comment.