Download the PHP package interaction-design-foundation/laravel-geoip without Composer

On this page you can find all versions of the php package interaction-design-foundation/laravel-geoip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-geoip

GeoIP for Laravel

run-tests Type coverage Psalm error level

Determine the geographical location and currency of website visitors based on their IP addresses.

Actively maintained fork of torann/geoip with modern PHP/Laravel support, better types, and additional features. Migration guide.

Installation

Publish the config file:

Set the GEOIP_SERVICE env variable to one of the supported services.

Quick Start

Use the geoip() helper or the GeoIP facade:

The Location object contains: ip, iso_code, country, city, state, state_name, postal_code, lat, lon, timezone, continent, currency, default, and cached.

It implements ArrayAccess, so both $location->city and $location['city'] work.

Services

Set the service via the GEOIP_SERVICE env variable or in config/geoip.php:

Service Key Requires
MaxMind Database maxmind_database geoip2/geoip2 package + license key
MaxMind Web API maxmind_api geoip2/geoip2 package + user ID & license key
IP-API ipapi API key (for HTTPS)
IPGeolocation ipgeolocation API key
IPData ipdata API key
IPFinder ipfinder API key
IP2Location ip2location API key

For detailed service configuration, see services documentation.

Configuration

Key options in config/geoip.php:

Caching

GeoIP caches lookups using Laravel's cache system to reduce API calls. Set the cache option to:

You can also configure cache_tags, cache_expires (TTL in seconds), and cache_prefix.

Currency Detection

When include_currency is enabled (default), the package resolves the visitor's currency from their country ISO code using the league/iso3166 package.

Default Location

Configure a fallback location returned when a lookup fails or the IP is local/invalid.

Artisan Commands

Changelog

See Releases for what has changed recently.

Contributing

See CONTRIBUTING for details.


All versions of laravel-geoip with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-curl Version *
illuminate/cache Version ^12.0 || ^13.0
illuminate/console Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
league/iso3166 Version ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package interaction-design-foundation/laravel-geoip contains the following files

Loading the files please wait ...