company_key); /** @var \App\Models\CompanyGateway */ return CompanyGateway::withTrashed()->find($this->decodePrimaryKey($this->company_gateway_id)); } /** * Resolve payment hash. * * @return null|bool|\App\Models\PaymentHash */ public function getPaymentHash() { if ($this->query('hash')) { MultiDB::findAndSetDbByCompanyKey($this->company_key); /** @var \App\Models\PaymentHash */ return PaymentHash::where('hash', $this->query('hash'))->firstOrFail(); } return false; } /** * Resolve company from company_key parameter. * * @return null|\App\Models\Company */ public function getCompany(): ?Company { MultiDB::findAndSetDbByCompanyKey($this->company_key); /** @var \App\Models\Company */ return Company::where('company_key', $this->company_key)->firstOrFail(); } }