Skip to content

Commit

Permalink
Move migration generator into same service provider as every other ge…
Browse files Browse the repository at this point in the history
…nerator.
  • Loading branch information
taylorotwell committed Dec 19, 2016
1 parent b892805 commit baa6054
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
25 changes: 2 additions & 23 deletions src/Illuminate/Database/MigrationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Illuminate\Database\Console\Migrations\MigrateCommand;
use Illuminate\Database\Console\Migrations\RefreshCommand;
use Illuminate\Database\Console\Migrations\RollbackCommand;
use Illuminate\Database\Console\Migrations\MigrateMakeCommand;
use Illuminate\Database\Migrations\DatabaseMigrationRepository;

class MigrationServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -92,7 +91,7 @@ protected function registerCreator()
*/
protected function registerCommands()
{
$commands = ['Migrate', 'Rollback', 'Reset', 'Refresh', 'Install', 'Make', 'Status'];
$commands = ['Migrate', 'Rollback', 'Reset', 'Refresh', 'Install', 'Status'];

// We'll simply spin through the list of commands that are migration related
// and register each one of them with an application container. They will
Expand All @@ -105,7 +104,7 @@ protected function registerCommands()
// register them with the Artisan start event so that these are available
// when the Artisan application actually starts up and is getting used.
$this->commands(
'command.migrate', 'command.migrate.make',
'command.migrate',
'command.migrate.install', 'command.migrate.rollback',
'command.migrate.reset', 'command.migrate.refresh',
'command.migrate.status'
Expand Down Expand Up @@ -160,25 +159,6 @@ protected function registerRefreshCommand()
});
}

/**
* Register the "make" migration command.
*
* @return void
*/
protected function registerMakeCommand()
{
$this->app->singleton('command.migrate.make', function ($app) {
// Once we have the migration creator registered, we will create the command
// and inject the creator. The creator is responsible for the actual file
// creation of the migrations, and may be extended by these developers.
$creator = $app['migration.creator'];

$composer = $app['composer'];

return new MigrateMakeCommand($creator, $composer);
});
}

/**
* Register the "status" migration command.
*
Expand Down Expand Up @@ -215,7 +195,6 @@ public function provides()
'command.migrate.rollback', 'command.migrate.reset',
'command.migrate.refresh', 'command.migrate.install',
'command.migrate.status', 'migration.creator',
'command.migrate.make',
];
}
}
21 changes: 21 additions & 0 deletions src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
use Illuminate\Foundation\Console\VendorPublishCommand;
use Illuminate\Database\Console\Seeds\SeederMakeCommand;
use Illuminate\Foundation\Console\NotificationMakeCommand;
use Illuminate\Database\Console\Migrations\MigrateMakeCommand;
use Illuminate\Notifications\Console\NotificationTableCommand;

class ArtisanServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -92,6 +93,7 @@ class ArtisanServiceProvider extends ServiceProvider
'ListenerMake' => 'command.listener.make',
'MailMake' => 'command.mail.make',
'MiddlewareMake' => 'command.middleware.make',
'MigrateMake' => 'command.migrate.make',
'ModelMake' => 'command.model.make',
'NotificationMake' => 'command.notification.make',
'NotificationTable' => 'command.notification.table',
Expand Down Expand Up @@ -350,6 +352,25 @@ protected function registerMiddlewareMakeCommand()
});
}

/**
* Register the command.
*
* @return void
*/
protected function registerMigrateMakeCommand()
{
$this->app->singleton('command.migrate.make', function ($app) {
// Once we have the migration creator registered, we will create the command
// and inject the creator. The creator is responsible for the actual file
// creation of the migrations, and may be extended by these developers.
$creator = $app['migration.creator'];

$composer = $app['composer'];

return new MigrateMakeCommand($creator, $composer);
});
}

/**
* Register the command.
*
Expand Down

0 comments on commit baa6054

Please sign in to comment.