![]() Use the IPv4 BIN file if you just need to query IPv4 addresses. IP2Location Commercial BIN Data (Comprehensive): įor IP2Location API key, you can sign up IP2Location Web Service to get one free API key.This library requires either IP2Location BIN data file or IP2Location API key to function. Route::get('test', Enter the URL /public/test and run. Print_r( IP2LocationLaravel:: decimalToIpv4( 134744072)) echo '' Print_r( IP2LocationLaravel:: ipv4ToDecimal( '8.8.8.8')) echo '' To use IP2Location IPTools class, add the below lines into the controller file.'IP2LocationLanguage' => 'en', // Optional. Refer to for the list of available addons. 'IP2LocationUsessl' => false, // Optional. Choose the package you would like to use. 'IP2LocationPackage' => 'WS1', // Required. In the site_vars.php, save the following contents:.To use IP2Location web service, create a new file called "site_vars.php" in config directory.You should see the information of 8.8.8.8 IP address. Add the following line into the routes/web.php file.To use IP2Location databases, add the below lines into the controller file.Įcho 'IP Version : '.Open the app/Http/Controllers/TestController.php in any text editor.Php artisan make:controller TestController Create a TestController in Laravel using the below command line.Rename the BIN file to IP2LOCATION.BIN.Unzip and copy the BIN file into database/ip2location/ folder.To use IP2Location databases, create a folder named as ip2location in the database directory.This section will explain how to use this extension to query from BIN database and web service. IP2Location Laravel extension is able to query the IP address information from either BIN database or web service. Run the command: composer require ip2location/ip2location-laravel to download the package into the Laravel platform. Note: This extension works in Laravel 6, Laravel 7, Laravel 8 and Laravel 9. It has been optimized for speed and memory utilization. IP2Location Laravel extension enables the user to find the country, region, 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 and IAB advertising category from IP address using IP2Location database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |