DB_NINJA_1]); $this->forceMigrate(); } private function forceMigrate() { $data = []; $company = Company::where('plan', 'free') ->with('accounts') ->first(); $user = $company->accounts->first()->users()->whereNull('public_id')->orWhere('public_id', 0)->first(); $db = DB_NINJA_1; if($company){ foreach($company->accounts as $key => $account) { $data['companies'][$key]['id'] = $account->id; } $this->dispatch(new HostedMigration($user, $data, $db, true)); } } }