getTokenContent()); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'code' => 'required|string', 'state' => 'required|string', 'realmId' => 'required|string', ]; } /** * Resolve one-time token instance. * * @return mixed */ public function getTokenContent() { $token = Cache::get($this->state); $data = Cache::get($token); return $data; } public function getContact() { return User::findOrFail($this->getTokenContent()['user_id']); } public function getCompany() { return Company::where('company_key', $this->getTokenContent()['company_key'])->firstOrFail(); } }