setName('tenants:migrate-fresh'); } /** * Execute the console command. * * @return mixed */ public function handle() { tenancy()->all($this->option('tenants'))->each(function ($tenant) { $this->line("Tenant: {$tenant->id}"); $tenant->run(function ($tenant) { $this->info('Dropping tables.'); $this->call('db:wipe', array_filter([ '--database' => $tenant->getConnectionName(), '--force' => true, ])); $this->info('Migrating.'); $this->callSilent('tenants:migrate', [ '--tenants' => [$tenant->id], ]); }); }); $this->info('Done.'); } }