Download the PHP package lostlink/laravel-geoip without Composer

On this page you can find all versions of the php package lostlink/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

Geoip Wrapper with Laravel Support

Latest Stable Version MIT License Run Tests Coverage StyleCI Total Downloads

Supported Drivers (Services)

Requirements

Installation

Install via composer

Laravel

There is a Laravel service provider and facade available.

Add the following to the providers array in your config/app.php

Next add the following to the aliases array in your config/app.php

Next run php artisan vendor:publish --provider="LostLink\GeoIP\GeoIPServiceProvider" --tag="config" to publish the config file.

Using an older version of PHP / Laravel?

If you are on a PHP version below 7.2 or a Laravel version below 5.8 just use an older version of this package.

Usage

The geoip class takes a config array as the first parameter or defaults to using the ip-api driver.

Example:

IPStack

To use the ipstack as the driver set the config.

Example:

IP-API

To use the ip-api pro service you can set the options in your config.

Pro Example:

Maxmind Database

To use Maxmind database as the driver you can set the options in your config.

Database Example:

Maxmind Api

To use Maxmind api as the driver you can set the options in your config.

Web API Example:

Telize

To use telize as the driver set the config, and your api key.

Example:

Laravel

To use this package in Laravel, simply update the config file in config/geoip.php to get the same effect. The driver can be set using the GEOIP_DRIVER env.

Available Methods

GeoIP will try to determine the ip using the following http headers: HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, HTTP_X_FORWARDED, HTTP_FORWARDED_FOR, HTTP_FORWARDED, REMOTE_ADDR in this order. Optionally use the setIp method to set it.

There are a number of available methods to pull out the required information. All methods will return an empty string if data is unavailable.

Get latitude

Get longitude

Get city

Get country

Get country code

Get region

Get region code

Get postal code

Get timezone

Get isp (not supported on all drivers)

Get all geo information

Get raw geo information

Update Database

There is an update command available to help with updating and installing a local geoip database. The following will download and install/update the database file to /path/to/database.mmdb. As of 30th December 2019, Maxmind requires users to create an account and use a license key to download the databases.

Laravel

Once you have registered the service provider (supports auto discovery), you can use the command php artisan geoip:update

Services

IPStack

IPStack offers a JSON IP and GeoIP REST API allowing to get a visitor IP address and to query location information from any IP address.

IP-API

IP-API is a free (or paid) service that can also be used instead of the database file or the paid maxmind service. They do have some limitations on the free service so please have a look at the docs first.

Maxmind

You can use the free database from maxmind (license_key required) or their web api service. You can signup and get a free license code here.

Telize

Telize offers a JSON IP and GeoIP REST API allowing to get a visitor IP address and to query location information from any IP address. It outputs JSON-encoded IP geolocation data, and supports both Cross-origin resource sharing (CORS) and JSONP.

License

MIT


All versions of laravel-geoip with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0 || ^8.1
illuminate/support Version ^v8 || ^v9
illuminate/console Version ^v8 || ^v9
guzzlehttp/guzzle Version ^7
geoip2/geoip2 Version ^v2.12
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 lostlink/laravel-geoip contains the following files

Loading the files please wait ....