New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

cyber-duck/laravel-maxmind-geolocate

Laravel Package to utilise MaxMind GeoLite2 Database for IP based GeoLocation
1,382 2
Install
composer require cyber-duck/laravel-maxmind-geolocate
Latest Version:v1.0.2
PHP:^8.1
Laravel:8 · 9 · 10
License:MIT
Last Updated:Sep 8, 2023
Links: GitHub  ·  Packagist
Maintainer: cyber-duck

Laravel GeoLocation Package

This package utilises the MaxMind GeoLite databases to allow GeoLocation of an IP Address.

Console Commands

php artisan geolocation:update

Downloads a recent archive of the database from MaxMind, validates the hash, and stores on a remote disk (e.g S3) as specified in configuration.

php artisan geolocation:fetch

Fetches, extracts, and moves to application storage, the archive previously stored on a remove disk (e.g S3)

Usage

Once a database has been downloaded and extracted to the app local storage directory, to geolocate an IP address, use the provided facade, as such:

use CyberDuck\GeoLocate\Facades\GeoLocate;

$result = GeoLocate::country('1.2.3.4');

// $result is an instance of \GeoIp2\Record\Country

$result->isoCode // == 'GB' for example.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
v1.0.2 ^8.1 ^8.67|^9.0|^10.0 MIT
v1.0.1 ^8.1 ^8.67|^9.0|^10.0 MIT
v1.0.0 ^8.1 ^8.67|^9.0|^10.0 MIT