addOption('--drop-views', null, InputOption::VALUE_NONE, 'Drop views along with tenant tables.', null); $this->setName('tenants:migrate-fresh'); } public function handle(): void { tenancy()->runForMultiple($this->getTenants(), function ($tenant) { $this->info('Dropping tables.'); $this->call('db:wipe', array_filter([ '--database' => 'tenant', '--drop-views' => $this->option('drop-views'), '--force' => true, ])); $this->info('Migrating.'); $this->callSilent('tenants:migrate', [ '--tenants' => [$tenant->getTenantKey()], '--force' => true, ]); }); $this->info('Done.'); } }