Skip to content

Commit 10824dc

Browse files
authored
refactor: drop ipstack and telize (#54)
1 parent 4a24afa commit 10824dc

File tree

8 files changed

+5
-376
lines changed

8 files changed

+5
-376
lines changed

README.md

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ GeoIP
1313

1414
## Supported Drivers ([Services](#services))
1515

16-
* [IPStack](https://ipstack.com/)
1716
* [IP-API](http://ip-api.com/)
1817
* [Maxmind](https://www.maxmind.com/)
19-
* [Telize](https://market.mashape.com/fcambus/telize/)
2018

2119
## Requirements
2220

23-
* PHP >= 7.2
21+
* PHP >= 8.0
2422

2523
## Installation
2624

@@ -50,7 +48,7 @@ Next run `php artisan vendor:publish --provider="PulkitJalan\GeoIP\GeoIPServiceP
5048

5149
#### Using an older version of PHP / Laravel?
5250

53-
If you are on a PHP version below 7.2 or a Laravel version below 5.8 just use an older version of this package.
51+
If you are on a PHP version below 8.0 or a Laravel version below 9.0, use an older version of this package.
5452

5553
## Usage
5654

@@ -69,21 +67,6 @@ $lat = $geoip->getLatitude(); // 51.5141
6967
$lon = $geoip->getLongitude(); // -3.1969
7068
```
7169

72-
#### IPStack
73-
74-
To use the ipstack as the driver set the config.
75-
76-
Example:
77-
```php
78-
$config = [
79-
'driver' => 'ipstack',
80-
'ipstack' => [
81-
'key' => 'YOUR IPSTACK KEY',
82-
'secure' => true, // (optional) use https
83-
],
84-
];
85-
```
86-
8770
#### IP-API
8871

8972
To use the ip-api pro service you can set the options in your config.
@@ -127,20 +110,6 @@ $config = [
127110
];
128111
```
129112

130-
#### Telize
131-
132-
To use telize as the driver set the config, and your api key.
133-
134-
Example:
135-
```php
136-
$config = [
137-
'driver' => 'telize',
138-
'telize' => [
139-
'key' => 'YOUR TELIZE KEY',
140-
],
141-
];
142-
```
143-
144113
### Laravel
145114

146115
To use this package in Laravel, simply update the config file in `config/geoip.php` to get the same effect. The driver can be set using the `GEOIP_DRIVER` env.
@@ -292,18 +261,10 @@ Once you have registered the service provider (supports auto discovery), you can
292261

293262
## Services
294263

295-
#### IPStack
296-
297-
IPStack offers a JSON IP and GeoIP REST API allowing to get a visitor IP address and to query location information from any IP address.
298-
299264
#### IP-API
300265

301266
IP-API is a free (or paid) service that can also be used instead of the database file or the paid maxmind service. They do have some limitations on the free service so please have a look at the [docs](http://ip-api.com/docs/) first.
302267

303268
#### Maxmind
304269

305-
You can use the free database from maxmind (license_key required) or their web api service. You can signup and get a free license code [here](https://www.maxmind.com/en/geolite2/signup).
306-
307-
#### Telize
308-
309-
Telize offers a JSON IP and GeoIP REST API allowing to get a visitor IP address and to query location information from any IP address. It outputs JSON-encoded IP geolocation data, and supports both Cross-origin resource sharing (CORS) and JSONP.
270+
You can use the free database from maxmind (license_key required) or their web api service. You can signup and get a free license code [here](https://www.maxmind.com/en/geolite2/signup).

composer.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
"homepage": "https://github.com/pulkitjalan/geoip",
55
"keywords": [
66
"geoip",
7-
"ipstack",
87
"ip-api",
9-
"maxmind",
10-
"telize"
8+
"maxmind"
119
],
1210
"license": "MIT",
1311
"authors": [

config/geoip.php

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
| GeoIP Driver Type
77
|--------------------------------------------------------------------------
88
|
9-
| Supported: "ipstack", "ip-api", "maxmind_database", "maxmind_api", "telize"
9+
| Supported: "ip-api", "maxmind_database", "maxmind_api"
1010
|
1111
*/
1212
'driver' => env('GEOIP_DRIVER', 'ip-api'),
@@ -18,16 +18,6 @@
1818
*/
1919
'random' => env('GEOIP_RANDOM', false),
2020

21-
/*
22-
|--------------------------------------------------------------------------
23-
| IPStack Driver
24-
|--------------------------------------------------------------------------
25-
*/
26-
'ipstack' => [
27-
// Get your access key here: https://ipstack.com/product
28-
'key' => env('GEOIP_IPSTACK_KEY'),
29-
],
30-
3121
/*
3222
|--------------------------------------------------------------------------
3323
| IP-API Driver
@@ -65,15 +55,4 @@
6555
//local required on client call but defaults to 'en' for english.
6656
'locales' => ['en'],
6757
],
68-
69-
/*
70-
|--------------------------------------------------------------------------
71-
| Telize Driver
72-
|--------------------------------------------------------------------------
73-
*/
74-
'telize' => [
75-
// Get your API key here: https://market.mashape.com/fcambus/telize
76-
'key' => env('GEOIP_TELIZE_KEY'),
77-
'secure' => env('GEOIP_TELIZE_SECURE', true),
78-
],
7958
];

src/Drivers/IpStackDriver.php

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/Drivers/TelizeDriver.php

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/GeoIPManager.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
use Illuminate\Support\Str;
77
use GuzzleHttp\Client as GuzzleClient;
88
use PulkitJalan\GeoIP\Drivers\IPApiDriver;
9-
use PulkitJalan\GeoIP\Drivers\TelizeDriver;
10-
use PulkitJalan\GeoIP\Drivers\IpStackDriver;
119
use PulkitJalan\GeoIP\Drivers\MaxmindApiDriver;
1210
use PulkitJalan\GeoIP\Drivers\AbstractGeoIPDriver;
1311
use PulkitJalan\GeoIP\Drivers\MaxmindDatabaseDriver;
@@ -52,16 +50,6 @@ public function getDriver($driver = null): AbstractGeoIPDriver
5250
return $this->{$method}(Arr::get($this->config, $driver, []));
5351
}
5452

55-
/**
56-
* Get the ip stack driver.
57-
*
58-
* @return \PulkitJalan\GeoIP\IpStackDriver
59-
*/
60-
protected function createIpStackDriver(array $data): IpStackDriver
61-
{
62-
return new IpStackDriver($data, $this->guzzle);
63-
}
64-
6553
/**
6654
* Get the ip-api driver.
6755
*
@@ -91,14 +79,4 @@ protected function createMaxmindApiDriver(array $data): MaxmindApiDriver
9179
{
9280
return new MaxmindApiDriver($data, $this->guzzle);
9381
}
94-
95-
/**
96-
* Get the telize driver.
97-
*
98-
* @return \PulkitJalan\GeoIP\TelizeDriver
99-
*/
100-
protected function createTelizeDriver(array $data): TelizeDriver
101-
{
102-
return new TelizeDriver($data, $this->guzzle);
103-
}
10482
}

0 commit comments

Comments
 (0)