diff --git a/composer.json b/composer.json index 340f399..ddeb692 100644 --- a/composer.json +++ b/composer.json @@ -31,5 +31,12 @@ "config": { "preferred-install": "dist" }, - "minimum-stability": "dev" + "minimum-stability": "dev", + "extra": { + "laravel": { + "providers": [ + "Franzose\\ClosureTable\\ClosureTableServiceProvider" + ] + } + } } diff --git a/src/Franzose/ClosureTable/Generators/Migration.php b/src/Franzose/ClosureTable/Generators/Migration.php index 8d7937b..256a373 100644 --- a/src/Franzose/ClosureTable/Generators/Migration.php +++ b/src/Franzose/ClosureTable/Generators/Migration.php @@ -30,14 +30,17 @@ public function create(array $options) $stubPrefix = $useInnoDB ? '-innodb' : ''; $path = $this->getPath($options['entity-table'], $options['migrations-path']); - $stub = $this->getPath('migration' . $stubPrefix, 'migrations'); + $stub = $this->getStub('migration' . $stubPrefix, 'migrations'); - $this->filesystem->put($path, $this->parseStub($stub), [ + $this->filesystem->put( + $path, + $this->parseStub($stub, [ 'entity_table' => $options['entity-table'], 'entity_class' => $entityClass, 'closure_table' => $options['closure-table'], 'closure_class' => $closureClass, - ]); + ]) + ); return [$path]; } @@ -80,6 +83,6 @@ protected function getPath($name, $path) } $this->usedTimestamps[] = $timestamp; - return $path . '/' . $timestamp->format('Y_m_d_His') . '_' . $this->getName($name) . '.php'; + return $path . '/' . $timestamp->format('Y_m_d_His') . '_' . $this->getName($name) . '_migration.php'; } }