From 9aceaa528fe4e026d835d54e5c573ad34e0c9b8c Mon Sep 17 00:00:00 2001 From: Darryl Anaud Date: Wed, 20 Sep 2017 18:38:56 +0800 Subject: [PATCH 1/3] Fix the issue on the generated migration file Issue #201 --- src/Franzose/ClosureTable/Generators/Migration.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Franzose/ClosureTable/Generators/Migration.php b/src/Franzose/ClosureTable/Generators/Migration.php index 8d7937b..a82e52c 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]; } From de0227b61e4264574a8763b28c47d8a9b10738aa Mon Sep 17 00:00:00 2001 From: Darryl Anaud Date: Wed, 20 Sep 2017 18:39:46 +0800 Subject: [PATCH 2/3] Implement laravel 5.5 package auto-discovery --- composer.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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" + ] + } + } } From 1acc23afba0e8b90bf0b00d8fb0bc8f0e676d95f Mon Sep 17 00:00:00 2001 From: Darryl Anaud Date: Thu, 21 Sep 2017 16:56:41 +0800 Subject: [PATCH 3/3] Fix issue on migration filename does not match migration class name --- src/Franzose/ClosureTable/Generators/Migration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Franzose/ClosureTable/Generators/Migration.php b/src/Franzose/ClosureTable/Generators/Migration.php index a82e52c..256a373 100644 --- a/src/Franzose/ClosureTable/Generators/Migration.php +++ b/src/Franzose/ClosureTable/Generators/Migration.php @@ -83,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'; } }