"name"]); } // Object methods /** * @return Address * @throws \Exception */ public function getAddress(): Address { $address = Address::get($this->address_id); return $address ?: new Address(); } public function getSlug(): string { return Util::slug("$this->name $this->id"); } public function getUrl(): string { return sprintf("/customers/%s", $this->getSlug()); } /** * @return Location[] */ public function getLocations(): array { return Location::query(["customer_id" => $this->id, "dts_deleted" => null]); } }