{"id":15561129,"url":"https://github.com/ip2location/ip2proxy-laravel","last_synced_at":"2025-04-15T16:41:36.142Z","repository":{"id":56993028,"uuid":"105621980","full_name":"ip2location/ip2proxy-laravel","owner":"ip2location","description":"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.","archived":false,"fork":false,"pushed_at":"2024-10-08T06:16:25.000Z","size":21,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T08:23:08.535Z","etag":null,"topics":["ip2proxy","ip2proxy-database","ip2proxy-laravel","laravel","laravel-extension","laravel-framework","laravel-package","proxy-database","tor-exits","vpn-anonymizer","web-proxy"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ip2location.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-10-03T06:46:55.000Z","updated_at":"2024-12-03T19:49:23.000Z","dependencies_parsed_at":"2024-01-03T02:54:52.891Z","dependency_job_id":"9a4ddf0d-9d41-4edc-9d1c-83c79df4e01b","html_url":"https://github.com/ip2location/ip2proxy-laravel","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"5b5249b6cb032672e496dd1f38c4b12dab1b9539"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fip2proxy-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fip2proxy-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fip2proxy-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ip2location%2Fip2proxy-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ip2location","download_url":"https://codeload.github.com/ip2location/ip2proxy-laravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249110303,"owners_count":21214304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ip2proxy","ip2proxy-database","ip2proxy-laravel","laravel","laravel-extension","laravel-framework","laravel-package","proxy-database","tor-exits","vpn-anonymizer","web-proxy"],"created_at":"2024-10-02T16:05:39.631Z","updated_at":"2025-04-15T16:41:36.121Z","avatar_url":"https://github.com/ip2location.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IP2Proxy Laravel Extension\r\n[![Latest Stable Version](https://img.shields.io/packagist/v/ip2location/ip2proxy-laravel.svg)](https://packagist.org/packages/ip2location/ip2proxy-laravel)\r\n[![Total Downloads](https://img.shields.io/packagist/dt/ip2location/ip2proxy-laravel.svg?style=flat-square)](https://packagist.org/packages/ip2location/ip2proxy-laravel)\r\n\r\nIP2Proxy Laravel extension enables the user to query an IP address if it was being used as VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges, residential proxies, consumer privacy networks, and enterprise private networks.\r\n\r\n*Note: This extension works in Laravel 6, Laravel 7, Laravel 8 and Laravel 9, Laravel 10 and Laravel 11.*\r\n\r\n\r\n## INSTALLATION\r\n\r\nRun the command: `composer require ip2location/ip2proxy-laravel` to download the package into the Laravel platform.\r\n\r\n## USAGE\r\n\r\nIP2Proxy 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.\r\n\r\n### BIN DATABASE\r\n\r\n1. Download IP2Proxy BIN database\r\n    - IP2Proxy free LITE database at https://lite.ip2location.com\r\n    - IP2Proxy commercial database at https://www.ip2location.com/proxy-database\r\n2. To use IP2Proxy databases, create a folder named as `ip2proxy` in the `database` directory.\r\n3. Unzip and copy the BIN file into `database/ip2proxy/` folder. \r\n4. Rename the BIN file to IP2PROXY.BIN.\r\n5. Create a **TestController** in Laravel using the below command line\r\n```\r\nphp artisan make:controller TestController\r\n```\r\n6. Open the **app/Http/Controllers/TestController.php** in any text editor.\r\n7. To use IP2Proxy databases, add the below lines into the controller file\r\n```php\r\n\u003c?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse IP2ProxyLaravel;            //use IP2ProxyLaravel class\r\n\r\nclass TestController extends Controller\r\n{\r\n    //Create a lookup function for display\r\n    public function lookup(){\r\n        //Try query the geolocation information of 1.2.3.4 IP address\r\n        $records = IP2ProxyLaravel::get('1.2.3.4', 'bin');\r\n\r\n        echo '\u003cp\u003e\u003cstrong\u003eIP Address: \u003c/strong\u003e' . $records['ipAddress'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eIP Number: \u003c/strong\u003e' . $records['ipNumber'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eIP Version: \u003c/strong\u003e' . $records['ipVersion'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eCountry Code: \u003c/strong\u003e' . $records['countryCode'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eCountry: \u003c/strong\u003e' . $records['countryName'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eState: \u003c/strong\u003e' . $records['regionName'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eCity: \u003c/strong\u003e' . $records['cityName'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eProxy Type: \u003c/strong\u003e' . $records['proxyType'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eIs Proxy: \u003c/strong\u003e' . $records['isProxy'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eISP: \u003c/strong\u003e' . $records['isp'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eDomain: \u003c/strong\u003e' . $records['domain'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eUsage Type: \u003c/strong\u003e' . $records['usageType'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eASN: \u003c/strong\u003e' . $records['asn'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eAS: \u003c/strong\u003e' . $records['as'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eLast Seen: \u003c/strong\u003e' . $records['lastSeen'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eThreat: \u003c/strong\u003e' . $records['threat'] . '\u003c/p\u003e';\r\n        echo '\u003cp\u003e\u003cstrong\u003eProvider: \u003c/strong\u003e' . $records['provider'] . '\u003c/p\u003e';\r\n    }\r\n}\r\n```\r\n8. Add the following line into the *routes/web.php* file.\r\n```\r\nRoute::get('test', 'App\\Http\\Controllers\\TestController@lookup');\r\n```\r\n9. Enter the URL \u003cyour domain\u003e/test and run. You should see the information of **1.2.3.4** IP address.\r\n\r\n### WEB SERVICE\r\n\r\n1. To use IP2Location.io or IP2Proxy Web Service, create a new file called \"site_vars.php\" in `config` directory.\r\n2. In the site_vars.php, save the following contents for IP2Location.io:\r\n```\r\n\u003c?php\r\nreturn [\r\n    'IP2LocationioAPIKey' =\u003e 'your_api_key', // Required. Your IP2Location.io API key.\r\n    'IP2LocationioLanguage' =\u003e 'en', // Optional. Refer to https://www.ip2location.io/ip2location-documentation for available languages.\r\n];\r\n```\r\nOr save the following contents for IP2Proxy:\r\n```php\r\n\u003c?php\r\nreturn [\r\n    'IP2ProxyAPIKey' =\u003e 'your_api_key', // Required. Your IP2Proxy API key.\r\n    'IP2ProxyPackage' =\u003e 'PX1', // Required. Choose the package you would like to use.\r\n    'IP2ProxyUsessl' =\u003e false, // Optional. Use https or http.\r\n];\r\n```\r\n3. Create a **TestController** in Laravel using the below command line\r\n```\r\nphp artisan make:controller TestController\r\n```\r\n4. Open the **app/Http/Controllers/TestController.php** in any text editor.\r\n5. To use IP2Proxy Web Service, add the below lines into the controller file.\r\n```php\r\n\u003c?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nuse IP2ProxyLaravel;            //use IP2ProxyLaravel class\r\n\r\nclass TestController extends Controller\r\n{\r\n    //Create a lookup function for display\r\n    public function lookup(){\r\n        //Try query the geolocation information of 1.2.3.4 IP address\r\n        $records = IP2ProxyLaravel::get('1.2.3.4', 'ws');\r\n\r\n        echo '\u003cpre\u003e';\r\n        print_r($records);\r\n        echo '\u003c/pre\u003e';\r\n    }\r\n}\r\n\r\n```\r\n6. Add the following line into the *routes/web.php* file.\r\n```\r\nRoute::get('test', 'App\\Http\\Controllers\\TestController@lookup');\r\n```\r\n7. Enter the URL \u003cyour domain\u003e/test and run. You should see the information of **1.2.3.4** IP address.\r\n\r\n## DEPENDENCIES (IP2PROXY BIN DATA FILE)\r\n\r\nThis library requires IP2Proxy BIN data file to function. You may download the BIN data file at\r\n* IP2Proxy LITE BIN Data (Free): https://lite.ip2location.com\r\n* IP2Proxy Commercial BIN Data (Comprehensive): https://www.ip2location.com/proxy-database\r\n\r\n\r\n## SUPPORT\r\n\r\nEmail: support@ip2location.com\r\n\r\nWebsite: https://www.ip2location.com\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fip2location%2Fip2proxy-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fip2location%2Fip2proxy-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fip2location%2Fip2proxy-laravel/lists"}