Package Data | |
---|---|
Maintainer Username: | codedge |
Maintainer Contact: | holger.loesken@codedge.de (Holger Lösken) |
Package Create Date: | 2016-09-19 |
Package Last Update: | 2019-01-14 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-14 15:05:38 |
Package Statistics | |
---|---|
Total Downloads: | 174 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 3 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Lumen Countries is a bundle for Lumen 5.x, providing ISO 3166_2, 3166_3, currency, capital and more for all countries. It is based on Laravel-Countries made by webpatser (Christoph Kempen).
Install the package running:
$ composer require codedge/lumen-countries
Edit bootstrap/app.php
and add the Service Provider [1]
/*
|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
|
...
*/
$app->register(Codedge\Countries\CountriesServiceProvider::class); // [1]
Also register the vendor:publish
command in your app/Console/Kernel.php
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
// ...
BasicIT\LumenVendorPublish\VendorPublishCommand::class
];
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 --provider="Codedge\Countries\CountriesServiceProvider"
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
$this->call('CountriesSeeder');
You may now run the migration including the seed.
$ php artisan migrate --seed
After running this command the filled countries table will be available.