From 860e1ab5fa5e19fe362c2b19f4150961374f71b3 Mon Sep 17 00:00:00 2001 From: Christoph Kempen Date: Wed, 16 May 2018 08:22:32 +0200 Subject: [PATCH] command handle/fire for compatibility for older laravel versions --- src/commands/MigrationCommand.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/commands/MigrationCommand.php b/src/commands/MigrationCommand.php index a58e071..4ce11ba 100644 --- a/src/commands/MigrationCommand.php +++ b/src/commands/MigrationCommand.php @@ -1,4 +1,4 @@ -addNamespace('countries',substr(__DIR__,0,-8).'views'); } - + /** * Execute the console command. * * @return void */ - public function fire() + public function handle() { $this->line(''); $this->info('The migration process will create a migration file and a seeder for the countries list'); @@ -60,7 +60,7 @@ public function fire() $this->info( "Migration successfully created!" ); } else{ - $this->error( + $this->error( "Coudn't create migration.\n Check the write permissions". " within the app/database/migrations directory." ); @@ -97,7 +97,7 @@ protected function createMigration() $seconds = 0; - foreach ($migrationFiles as $migrationFile => $outputFile) { + foreach ($migrationFiles as $migrationFile => $outputFile) { if (sizeof(glob($migrationFile)) == 0) { $migrationFile = str_replace('*', date('Y_m_d_His', strtotime('+' . $seconds . ' seconds')), $migrationFile); @@ -131,5 +131,12 @@ protected function createMigration() return true; } - + + /** + * BC for older laravel versions + */ + public function fire() + { + $this->handle(); + } }