Download the PHP package gerardojbaez/geodata without Composer

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

GeoData

GeoData is a Laravel package that provides basic geographical data like Countries, Regions and Cities.

Content

Installation

Composer

Pull this package through Composer (file composer.json)

Run this command inside your terminal.

composer update

Service Provider

Add the package to your application service providers in config/app.php file.

Migrations and Seeders

Publish package migrations and seeders with:

php artisan vendor:publish

Then run migrations.

php artisan migrate

If you want all countries, run:

php artisan db:seed --class AllCountriesSeeder

If you want specific countries, run:

php artisan db:seed --class Gerardojbaez\\GeoData\\Seeders\\UnitedStatesSeeder
php artisan db:seed --class Gerardojbaez\\GeoData\\Seeders\\PuertoRicoSeeder
[...]

Check available countries below.

Available Countries

Countries
Afghanistan
Albania
Algeria
Andorra
Angola
Antigua and Barbuda
Argentina
Aruba
Australia
Austria
Bahamas
Barbados
Belgium
Belize
Bermuda
Bolivia
Brazil
Canada
Chile
China
Colombia
Costa Rica
Croatia
Cuba
Czech Republic
Denmark
Dominican Republic
Ecuador
El Salvador
Equatorial Guinea
Estonia
Finland
France
Germany
Greece
Greenland
Guatemala
Guyana
Haiti
Honduras
Hong Kong
India
Indonesia
Ireland
Israel
Italy
Ivory Coast
Jamaica
Japan
Latvia
Lebanon
Luxembourg
Malaysia
Mexico
Morocco
Netherlands
Nicaragua
Nigeria
Norway
Pakistan
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Poland
Portugal
Puerto Rico
Romania
Russia
Saint Lucia
San Marino
Singapore
South Africa
Spain
Sri Lanka
Sweden
Switzerland
Thailand
Turkey
United Kingdom
United States
Uruguay
Venezuela

Traits and Contracts

You can use GeoData traits when you need to define a relation to countries, regions and/or cities.

See the following example:

Usage

Installing Countries

In addition to install countries via command line using seeders, you can also install countries through the CountryInstaller class. This will help you create a "web interface" that will give your customers or users the ability to install countries as needed. The installer will check if the country has been already installed and in that case will throw Gerardojbaez\Geodata\Exceptions\CountryAlreadyInstalledException.

The installation include:

It's as simple as:

Models

This package comes with Gerardojbaez\GeoData\Models\Country, Gerardojbaez\GeoData\Models\Region and Gerardojbaez\GeoData\Models\City models.

Take a look at each model for more details.

Controllers

If you want to provide countries, regions and/or cities data to your frontend you may want to use Gerardojbaez\GeoData\Controllers\CountriesController, Gerardojbaez\GeoData\Controllers\RegionsController and Gerardojbaez\GeoData\Controllers\CitiesController controllers.

Controllers returns a json reponse containing (if any) the requested data.

Routes

This is an example. You can structure these routes as you want.

License

This package is free software distributed under the terms of the MIT license.


All versions of geodata with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version ~5.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 gerardojbaez/geodata contains the following files

Loading the files please wait ....