Download the PHP package ip2location/ip2location-laravel without Composer
On this page you can find all versions of the php package ip2location/ip2location-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ip2location/ip2location-laravel
More information about ip2location/ip2location-laravel
Files in ip2location/ip2location-laravel
Package ip2location-laravel
Short Description Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.
License MIT
Informations about the package ip2location-laravel
IP2Location Laravel Extension
IP2Location Laravel extension enables the user to find the country, region, district, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation, usage type, IP address type, IAB advertising category and ASN from IP address using IP2Location database. It has been optimized for speed and memory utilization.
Note: This extension works in Laravel 6, Laravel 7, Laravel 8, Laravel 9, Laravel 10 and Laravel 11.
INSTALLATION
Run the command: composer require ip2location/ip2location-laravel
to download the package into the Laravel platform.
USAGE
IP2Location Laravel extension is able to query the IP address 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
- Download IP2Location BIN database
- IP2Location free LITE database at https://lite.ip2location.com
- IP2Location commercial database at https://www.ip2location.com
- To use IP2Location databases, create a folder named as
ip2location
in thedatabase
directory. - Unzip and copy the BIN file into
database/ip2location/
folder. - Rename the BIN file to IP2LOCATION.BIN.
-
Create a TestController in Laravel using the below command line
- Open the app/Http/Controllers/TestController.php in any text editor.
-
To use IP2Location databases, add the below lines into the controller file.
-
Add the following line into the routes/web.php file.
- Enter the URL
/test and run. You should see the information of 8.8.8.8 IP address.
WEB SERVICE
- To use IP2Location.io or IP2Location web service, create a new file called "site_vars.php" in
config
directory. - In the site_vars.php, save the following contents for IP2Location.io:
Or save the following contents for IP2Location:
-
Create a TestController in Laravel using the below command line
- Open the app/Http/Controllers/TestController.php in any text editor.
-
To use IP2Location databases, add the below lines into the controller file.
-
Add the following line into the routes/web.php file.
- Enter the URL
/test and run. You should see the information of 8.8.8.8 IP address.
IPTOOLS
-
Create a TestController in Laravel using the below command line
- Open the app/Http/Controllers/TestController.php in any text editor.
-
To use IP2Location IPTools class, add the below lines into the controller file.
-
Add the following line into the routes/web.php file.
- Enter the URL
/test and run.
DEPENDENCIES
This library requires either IP2Location BIN data file or IP2Location API key to function. You may download the BIN data file at
- IP2Location LITE BIN Data (Free): https://lite.ip2location.com
- IP2Location Commercial BIN Data (Comprehensive): https://www.ip2location.com
For IP2Location API key, you can sign up IP2Location Web Service to get one free API key.
IPv4 BIN vs IPv6 BIN
Use the IPv4 BIN file if you just need to query IPv4 addresses. Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
SUPPORT
Email: [email protected]
Website: https://www.ip2location.com