request = $request; $this->account = $account; } /** * Execute the job. * * @return void */ public function handle() : ?Company { $company = new Company(); $company->name = $this->request['first_name'] . ' ' . $this->request['last_name']; $company->account_id = $this->account->id; $company->company_key = $this->createHash(); $company->db = config('database.default'); $company->ip = request()->ip(); $company->settings = CompanySettings::defaults(); $company->save(); return $company; } }