wallet handling 3
This commit is contained in:
@@ -16,7 +16,16 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
//
|
// MigrationServiceProvider بهصورت deferred است؛ قبل از override کردن migrate
|
||||||
|
// باید migration.repository و migrator ثبت شوند (حتی در package:discover).
|
||||||
|
$this->app->register(MigrationServiceProvider::class);
|
||||||
|
|
||||||
|
$this->app->singleton('command.migrate', function ($app) {
|
||||||
|
return new MigrateCommand(
|
||||||
|
$app->make('migrator'),
|
||||||
|
$app->make(Dispatcher::class)
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,19 +35,6 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
if (! $this->app->runningInConsole()) {
|
//
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->app->extend('command.migrate', function ($command, $app) {
|
|
||||||
if (! $app->bound('migrator')) {
|
|
||||||
(new MigrationServiceProvider($app))->register();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new MigrateCommand(
|
|
||||||
$app->make('migrator'),
|
|
||||||
$app->make(Dispatcher::class)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user