Laravel Countries

Laravel Countries 是一个 Laravel 捆绑包,为所有国家提供 Almost ISO 3166_2、3166_3、货币、资本等信息。「Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.」

  • Owner: webpatser/laravel-countries
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

Laravel Countries

Total Downloads
Latest Stable Version
Latest Unstable Version

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

Please note that version 1.4 is Laravel 5 only, older versions of Laravel should use version 1.3.4 instead

Installation

Add webpatser/laravel-countries to composer.json.

"webpatser/laravel-countries": "dev-master"

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

Edit app/config/app.php and add the provider and filter

'providers' => [
    'Webpatser\Countries\CountriesServiceProvider',
]

Now add the alias.

'aliases' => [
    'Countries' => 'Webpatser\Countries\CountriesFacade',
]

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

Main metrics

Overview
Name With Ownerwebpatser/laravel-countries
Primary LanguagePHP
Program languagePHP (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2013-07-18 13:55:36
Pushed At2023-09-28 09:40:39
Last Commit At2023-02-08 12:09:34
Release Count20
Last Release Name1.5.4 (Posted on 2018-05-16 08:38:23)
First Release Name1.0 (Posted on 2014-06-27 11:29:59)
用户参与
Stargazers Count754
Watchers Count22
Fork Count226
Commits Count130
Has Issues Enabled
Issues Count70
Issue Open Count35
Pull Requests Count38
Pull Requests Open Count15
Pull Requests Close Count17
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private