Download the PHP package dynamiccarrots/laravel-ip2location without Composer

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

Laravel-Ip2Location

Ip2Location provides a free non-intrusive database to help you identify your visitors geographical location.

The data you receive from a users IP Address will depend on what database size you download from Ip2Location. The largest of these consists of Country, Region, City, Latitude, Longitude, Zipcode and Timezone.

Only download the database that you need, the large databases can have over 4 million rows. The smallest one has about 160K rows.

As this package uses the LITE/free version of Ip2Location you are not guaranteed 100% accuracy.

Installation

Download Ip2Location Database

Visit this page and download one of the DB files as a CSV, these range from DB1 to DB11. http://lite.ip2location.com/

You will need to create a folder in the database directory called "ip2location" and store the CSV in here with the name "ip2location.csv".

You should have the following structure.

Migrations

Create a new migration file in laravel by running the following command.

Copy the following migration in to the newly created migration file.

Run the migration.

Create update command

Due to the fact IP address ranges get moved around from ISP to ISP all the time. We need to update our database on a monthly basis if you want to stay up to date.

We need to have a command that will allow us to change the ip2location.csv file and use its data to refresh our database.

Run the following command.

This will create a new file in app/Console/Commands called RefreshIp2Location.php.

Replace the code in this new file with this.

Register the new command in /app/Console/Kernel.php by adding RefreshIp2Location::class to the $commands array, this will allow us to run this from the CLI.

Populate the database

Now we have a database set up with the correct table and the csv file stored in the right directory we can run the command to populate the database with the ip2location data.

Run this command.

Use Examples

Return the Country Code of a IP address

Provide your own IP Address and Ip2Location will convert this to a Country Code.

Return the Country Code client

Return the Country Code of the client


All versions of laravel-ip2location with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
league/csv Version ^8.2
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 dynamiccarrots/laravel-ip2location contains the following files

Loading the files please wait ....