MigrationServiceProvider.php 545 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Support\ServiceProvider;
  4. use App\Console\Commands\MigrateMaster;
  5. use App\Console\Commands\MigrateTenants;
  6. class MigrationServiceProvider extends ServiceProvider
  7. {
  8. public function register()
  9. {
  10. $this->app->singleton(\App\Services\MigrationService::class);
  11. }
  12. public function boot()
  13. {
  14. if ($this->app->runningInConsole()) {
  15. $this->commands([
  16. MigrateMaster::class,
  17. MigrateTenants::class,
  18. ]);
  19. }
  20. }
  21. }