database = $database; $this->setName('tenants:migrate'); $this->specifyParameters(); } /** * Execute the console command. * * @return mixed */ public function handle() { if (! $this->confirmToProceed()) { return; } $this->input->setOption('database', 'tenant'); tenant()->all($this->option('tenants'))->each(function ($tenant) { $this->line("Tenant: {$tenant['uuid']} ({$tenant['domain']})"); $this->database->connectToTenant($tenant); // Migrate parent::handle(); }); $this->database->disconnect(); } }