ip = $ip; if ($this->shouldPerformLookup()) { // Fetch details from the service $this->lookup(); } return $this; } /** * Return details of the IP address lookup. * * @return array */ public function getDetails() { return [ 'city' => $this->city, 'region' => $this->region, 'zipcode' => $this->zipcode, 'country' => $this->country, 'latitude' => $this->latitude, 'longitude' => $this->longitude, 'isp' => $this->isp, 'organization' => $this->organization, 'timezone' => $this->timezone, 'extra' => $this->extra, ]; } protected function shouldPerformLookup(): bool { return true; } }