From 14ee7edacdc2cb7b4513fc1167670fa552513bd7 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sat, 21 Jul 2018 07:48:49 +0800 Subject: [PATCH] Move migration and factory stubs to database directory --- src/Generators/MigrationGenerator.php | 2 +- src/Generators/ModelFactoryGenerator.php | 2 +- src/stubs/{ => database/factories}/model-factory.stub | 0 src/stubs/{ => database/migrations}/migration-create.stub | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename src/stubs/{ => database/factories}/model-factory.stub (100%) rename src/stubs/{ => database/migrations}/migration-create.stub (100%) diff --git a/src/Generators/MigrationGenerator.php b/src/Generators/MigrationGenerator.php index c15d63f..7623ff5 100644 --- a/src/Generators/MigrationGenerator.php +++ b/src/Generators/MigrationGenerator.php @@ -18,7 +18,7 @@ class MigrationGenerator extends BaseGenerator $migrationPath = $this->makeDirectory(database_path('migrations')); $migrationFilePath = $migrationPath.'/'.$prefix."_create_{$tableName}_table.php"; - $this->generateFile($migrationFilePath, $this->getContent('migration-create')); + $this->generateFile($migrationFilePath, $this->getContent('database/migrations/migration-create')); $this->command->info($this->modelNames['model_name'].' table migration generated.'); } diff --git a/src/Generators/ModelFactoryGenerator.php b/src/Generators/ModelFactoryGenerator.php index a023f13..4fe46bb 100644 --- a/src/Generators/ModelFactoryGenerator.php +++ b/src/Generators/ModelFactoryGenerator.php @@ -16,7 +16,7 @@ class ModelFactoryGenerator extends BaseGenerator $this->generateFile( $modelFactoryPath.'/'.$this->modelNames['model_name'].'Factory.php', - $this->getContent('model-factory') + $this->getContent('database/factories/model-factory') ); $this->command->info($this->modelNames['model_name'].' model factory generated.'); diff --git a/src/stubs/model-factory.stub b/src/stubs/database/factories/model-factory.stub similarity index 100% rename from src/stubs/model-factory.stub rename to src/stubs/database/factories/model-factory.stub diff --git a/src/stubs/migration-create.stub b/src/stubs/database/migrations/migration-create.stub similarity index 100% rename from src/stubs/migration-create.stub rename to src/stubs/database/migrations/migration-create.stub