<?php
namespace Torann\GeoIP\Services;
use GeoIp2\WebService\Client;
class MaxMindWebService extends AbstractService
{
/**
* Service client instance.
*
* @var \GeoIp2\WebService\Client
*/
protected $client;
/**
* The "booting" method of the service.
*
* @return void
*/
public function boot()
{
$this->client = new Client(
$this->config('user_id'),
$this->config('license_key'),
$this->config('locales', ['en'])
);
}
/**
* {@inheritdoc}
*/
public function locate($ip)
{
$record = $this->client->city($ip);
return $this->hydrate([
'ip' => $ip,
'iso_code' => $record->country->isoCode,
'country' => $record->country->name,
'city' => $record->city->name,
'state' => $record->mostSpecificSubdivision->isoCode,
'state_name' => $record->mostSpecificSubdivision->name,
'postal_code' => $record->postal->code,
'lat' => $record->location->latitude,
'lon' => $record->location->longitude,
'timezone' => $record->location->timeZone,
'continent' => $record->continent->code,
]);
}
}
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.