Files
boursecu_server/app/Providers/AppServiceProvider.php
T

45 lines
958 B
PHP
Raw Normal View History

2026-01-24 14:03:11 +00:00
<?php
namespace App\Providers;
2026-06-15 14:59:52 +03:30
use App\Console\Commands\MigrateCommand;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\MigrationServiceProvider;
2026-01-24 14:03:11 +00:00
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
2026-06-11 22:22:31 +03:30
//
2026-01-24 14:03:11 +00:00
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
2026-06-15 14:59:52 +03:30
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)
);
});
2026-01-24 14:03:11 +00:00
}
}