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