codedge / lumen-countries
Lumen Countries is a bundle for Lumen, providing ISO 3166_2, 3166_3, currency, capital and more for all countries. It is based on Laravel-Countries made by webpatser (Christoph Kempen).
Installs: 174
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 230
Open Issues: 0
Requires
- php: >=5.3.0
- basicit/lumen-vendor-publish: ^1.0
This package is auto-updated.
Last update: 2024-11-13 22:58:42 UTC
README
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).
Installation
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 ];
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 --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.