incloudout/countries

Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.

Installs: 24

Dependents: 0

Suggesters: 0

Security: 0

Type:laravel-library

v1.3.1 2018-05-31 10:48 UTC

This package is auto-updated.

Last update: 2024-11-29 05:32:24 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.

Please note that this package is for Laravel 5 only

Installation

Add incloudout/countries to composer.json.

composer require incloudout/countries

Run composer update to pull down the latest version of Country List.

Model

You can start by publishing the configuration. This is an optional step, it contains the table name and does not need to be altered. If the default name countries suits you, leave it. Otherwise run the following command

$ php artisan vendor:publish

Next generate the migration file:

$ php artisan countries:migration

It will generate the <timestamp>_setup_countries_table.php migration and the CountriesSeeder.php seeder. To make sure the data is seeded insert the following code in the seeds/DatabaseSeeder.php

//Seed the countries
$this->call('CountriesSeeder');
$this->command->info('Seeded the countries!'); 

You may now run it with the artisan migrate command:

$ php artisan migrate --seed

After running this command the filled countries table will be available