company = $company; $this->user = $user; $this->custom_token_name = $custom_token_name; } /** * Execute the job. * * @return void */ public function handle() : ?CompanyToken { $this->custom_token_name = $this->custom_token_name ?: $this->user->first_name. ' '. $this->user->last_name; $ct = CompanyToken::create([ 'user_id' => $this->user->id, 'account_id' => $this->company->account->id, 'token' => Str::random(64), 'name' => $this->custom_token_name ?: $this->user->first_name. ' '. $this->user->last_name, 'company_id' => $this->company->id, ]); return $ct; } }