'required|string', // nordigen redirects only with the ref-property 'lang' => 'string', ]; } /** * @return array{ * user_id: int, * company_key: string, * context: string, * is_react: bool, * institution_id: string, * lang: string, * redirect: string, * requisitionId: string * } */ public function getTokenContent(): array { $input = $this->all(); $data = Cache::get($input['ref']); return $data; } public function getCompany(): Company { $key = $this->getTokenContent()['company_key']; MultiDB::findAndSetDbByCompanyKey($key); return Company::where('company_key', $key)->firstOrFail(); } }