'object' ]; public function contacts() { return $this->hasMany(ClientContact::class)->orderBy('is_primary', 'desc'); } public function primary_contact() { return $this->hasMany(ClientContact::class)->whereIsPrimary(true); } public function company() { return $this->belongsTo(Company::class); } public function country() { return $this->belongsTo(Country::class); } public function shipping_country() { return $this->belongsTo(Country::class, 'shipping_country_id', 'id'); } public function timezone() { return Timezone::find($this->getMergedSettings()->timezone_id); } public function date_format() { return $this->getMergedSettings()->date_format; } public function datetime_format() { return $this->getMergedSettings()->datetime_format; } public function currency() { return Currency::find($this->getMergedSettings()->currency_id); } public function getMergedSettings() { return ClientSettings::buildClientSettings(new CompanySettings($this->company->settings), new ClientSettings($this->settings)); } public function documents() { return $this->morphMany(Document::class, 'documentable'); } }