diff --git a/README.md b/README.md index 4d8e1e4..9cf0303 100644 --- a/README.md +++ b/README.md @@ -1,131 +1,131 @@ -# IP2Proxy Laravel Extension -[![Latest Stable Version](https://img.shields.io/packagist/v/ip2location/ip2proxy-laravel.svg)](https://packagist.org/packages/ip2location/ip2proxy-laravel) -[![Total Downloads](https://img.shields.io/packagist/dt/ip2location/ip2proxy-laravel.svg?style=flat-square)](https://packagist.org/packages/ip2location/ip2proxy-laravel) - -IP2Proxy Laravel extension enables the user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits. - -*Note: This extension works in Laravel 6, Laravel 7 and Laravel 8.* - - -## INSTALLATION - -Run the command: `composer require ip2location/ip2proxy-laravel` to download the package into the Laravel platform. - -## USAGE - -IP2Proxy Laravel extension is able to query the IP address proxy information from either BIN database or web service. This section will explain how to use this extension to query from BIN database and web service. - -### BIN DATABASE - -1. Download IP2Proxy BIN database - - IP2Proxy free LITE database at https://lite.ip2location.com - - IP2Proxy commercial database at https://www.ip2location.com/proxy-database -2. To use IP2Proxy databases, create a folder named as `ip2proxy` in the `database` directory. -3. Unzip and copy the BIN file into `database/ip2proxy/` folder. -4. Rename the BIN file to IP2PROXY.BIN. -5. Create a **TestController** in Laravel using the below command line -``` -php artisan make:controller TestController -``` -6. Open the **app/Http/Controllers/TestController.php** in any text editor. -7. To use IP2Proxy databases, add the below lines into the controller file -```php -IP Address: ' . $records['ipAddress'] . '

'; - echo '

IP Number: ' . $records['ipNumber'] . '

'; - echo '

IP Version: ' . $records['ipVersion'] . '

'; - echo '

Country Code: ' . $records['countryCode'] . '

'; - echo '

Country: ' . $records['countryName'] . '

'; - echo '

State: ' . $records['regionName'] . '

'; - echo '

City: ' . $records['cityName'] . '

'; - echo '

Proxy Type: ' . $records['proxyType'] . '

'; - echo '

Is Proxy: ' . $records['isProxy'] . '

'; - echo '

ISP: ' . $records['isp'] . '

'; - echo '

Domain: ' . $records['domain'] . '

'; - echo '

Usage Type: ' . $records['usageType'] . '

'; - echo '

ASN: ' . $records['asn'] . '

'; - echo '

AS: ' . $records['as'] . '

'; - echo '

Last Seen: ' . $records['lastSeen'] . '

'; - echo '

Threat: ' . $records['threat'] . '

'; - echo '

Provider: ' . $records['provider'] . '

'; - } -} -``` -8. Add the following line into the *routes/web.php* file. -``` -Route::get('test', 'TestController@lookup'); -``` -9. Enter the URL /public/test and run. You should see the information of **1.2.3.4** IP address. - -### WEB SERVICE - -1. To use IP2Proxy Web Service, create a new file called "site_vars.php" in `config` directory. -2. In the site_vars.php, save the following contents: -```php - 'your_api_key', // Required. Your IP2Proxy API key. - 'IP2ProxyPackage' => 'PX1', // Required. Choose the package you would like to use. - 'IP2ProxyUsessl' => false, // Optional. Use https or http. -]; -``` -3. Create a **TestController** in Laravel using the below command line -``` -php artisan make:controller TestController -``` -4. Open the **app/Http/Controllers/TestController.php** in any text editor. -5. To use IP2Proxy Web Service, add the below lines into the controller file. -```php -'; - print_r($records); - echo ''; - } -} - -``` -6. Add the following line into the *routes/web.php* file. -``` -Route::get('test', 'TestController@lookup'); -``` -7. Enter the URL /public/test and run. You should see the information of **1.2.3.4** IP address. - -## DEPENDENCIES (IP2PROXY BIN DATA FILE) - -This library requires IP2Proxy BIN data file to function. You may download the BIN data file at -* IP2Proxy LITE BIN Data (Free): https://lite.ip2location.com -* IP2Proxy Commercial BIN Data (Comprehensive): https://www.ip2location.com/proxy-database - - -## SUPPORT - -Email: support@ip2location.com - -Website: https://www.ip2location.com +# IP2Proxy Laravel Extension +[![Latest Stable Version](https://img.shields.io/packagist/v/ip2location/ip2proxy-laravel.svg)](https://packagist.org/packages/ip2location/ip2proxy-laravel) +[![Total Downloads](https://img.shields.io/packagist/dt/ip2location/ip2proxy-laravel.svg?style=flat-square)](https://packagist.org/packages/ip2location/ip2proxy-laravel) + +IP2Proxy Laravel extension enables the user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits. + +*Note: This extension works in Laravel 6, Laravel 7, Laravel 8 and Laravel 9.* + + +## INSTALLATION + +Run the command: `composer require ip2location/ip2proxy-laravel` to download the package into the Laravel platform. + +## USAGE + +IP2Proxy Laravel extension is able to query the IP address proxy information from either BIN database or web service. This section will explain how to use this extension to query from BIN database and web service. + +### BIN DATABASE + +1. Download IP2Proxy BIN database + - IP2Proxy free LITE database at https://lite.ip2location.com + - IP2Proxy commercial database at https://www.ip2location.com/proxy-database +2. To use IP2Proxy databases, create a folder named as `ip2proxy` in the `database` directory. +3. Unzip and copy the BIN file into `database/ip2proxy/` folder. +4. Rename the BIN file to IP2PROXY.BIN. +5. Create a **TestController** in Laravel using the below command line +``` +php artisan make:controller TestController +``` +6. Open the **app/Http/Controllers/TestController.php** in any text editor. +7. To use IP2Proxy databases, add the below lines into the controller file +```php +IP Address: ' . $records['ipAddress'] . '

'; + echo '

IP Number: ' . $records['ipNumber'] . '

'; + echo '

IP Version: ' . $records['ipVersion'] . '

'; + echo '

Country Code: ' . $records['countryCode'] . '

'; + echo '

Country: ' . $records['countryName'] . '

'; + echo '

State: ' . $records['regionName'] . '

'; + echo '

City: ' . $records['cityName'] . '

'; + echo '

Proxy Type: ' . $records['proxyType'] . '

'; + echo '

Is Proxy: ' . $records['isProxy'] . '

'; + echo '

ISP: ' . $records['isp'] . '

'; + echo '

Domain: ' . $records['domain'] . '

'; + echo '

Usage Type: ' . $records['usageType'] . '

'; + echo '

ASN: ' . $records['asn'] . '

'; + echo '

AS: ' . $records['as'] . '

'; + echo '

Last Seen: ' . $records['lastSeen'] . '

'; + echo '

Threat: ' . $records['threat'] . '

'; + echo '

Provider: ' . $records['provider'] . '

'; + } +} +``` +8. Add the following line into the *routes/web.php* file. +``` +Route::get('test', 'TestController@lookup'); +``` +9. Enter the URL /public/test and run. You should see the information of **1.2.3.4** IP address. + +### WEB SERVICE + +1. To use IP2Proxy Web Service, create a new file called "site_vars.php" in `config` directory. +2. In the site_vars.php, save the following contents: +```php + 'your_api_key', // Required. Your IP2Proxy API key. + 'IP2ProxyPackage' => 'PX1', // Required. Choose the package you would like to use. + 'IP2ProxyUsessl' => false, // Optional. Use https or http. +]; +``` +3. Create a **TestController** in Laravel using the below command line +``` +php artisan make:controller TestController +``` +4. Open the **app/Http/Controllers/TestController.php** in any text editor. +5. To use IP2Proxy Web Service, add the below lines into the controller file. +```php +'; + print_r($records); + echo ''; + } +} + +``` +6. Add the following line into the *routes/web.php* file. +``` +Route::get('test', 'TestController@lookup'); +``` +7. Enter the URL /public/test and run. You should see the information of **1.2.3.4** IP address. + +## DEPENDENCIES (IP2PROXY BIN DATA FILE) + +This library requires IP2Proxy BIN data file to function. You may download the BIN data file at +* IP2Proxy LITE BIN Data (Free): https://lite.ip2location.com +* IP2Proxy Commercial BIN Data (Comprehensive): https://www.ip2location.com/proxy-database + + +## SUPPORT + +Email: support@ip2location.com + +Website: https://www.ip2location.com diff --git a/composer.json b/composer.json index 399eb48..60b8b3e 100644 --- a/composer.json +++ b/composer.json @@ -1,36 +1,37 @@ -{ - "name": "ip2location/ip2proxy-laravel", - "description": "Allows user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.", - "license": "MIT", - "keywords": [ - "laravel", - "laravel 6", - "laravel 7", - "laravel 8", - "IP2Proxy", - "proxy" - ], - "authors": [ - { - "name": "IP2Location", - "email": "support@ip2location.com" - } - ], - "minimum-stability": "stable", - "require": { - "php": ">=5.4", - "ip2location/ip2proxy-php": ">=4" - }, - "autoload": { - "psr-4": { - "Ip2location\\IP2ProxyLaravel\\": "src/" - } - }, - "extra": { - "laravel": { - "providers": [ - "Ip2location\\IP2ProxyLaravel\\IP2ProxyLaravelServiceProvider" - ] - } - } -} +{ + "name": "ip2location/ip2proxy-laravel", + "description": "Allows user to query an IP address if it was being used as open proxy, web proxy, VPN anonymizer and TOR exits.", + "license": "MIT", + "keywords": [ + "laravel", + "laravel 6", + "laravel 7", + "laravel 8", + "laravel 9", + "IP2Proxy", + "proxy" + ], + "authors": [ + { + "name": "IP2Location", + "email": "support@ip2location.com" + } + ], + "minimum-stability": "stable", + "require": { + "php": ">=5.4", + "ip2location/ip2proxy-php": ">=4" + }, + "autoload": { + "psr-4": { + "Ip2location\\IP2ProxyLaravel\\": "src/" + } + }, + "extra": { + "laravel": { + "providers": [ + "Ip2location\\IP2ProxyLaravel\\IP2ProxyLaravelServiceProvider" + ] + } + } +}