company_key); return true; } public function rules() { return [ // ]; } /** * Resolve company gateway. * * @param mixed $id * @return null|\App\Models\CompanyGateway */ public function getCompanyGateway() { return CompanyGateway::withTrashed()->findOrFail($this->decodePrimaryKey($this->company_gateway_id)); } /** * Resolve payment hash. * * @param string $hash * @return null|\App\Models\PaymentHash */ public function getPaymentHash() { if ($this->query('hash')) { 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 { return Company::where('company_key', $this->company_key)->firstOrFail(); } }