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