From 95731c818c24917e6fade7db1f4107c524950dc1 Mon Sep 17 00:00:00 2001 From: Einar Date: Mon, 11 Sep 2017 13:49:47 +0200 Subject: [PATCH 01/14] Remove extra whitespace --- src/Webpatser/Countries/Models/countries.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Webpatser/Countries/Models/countries.json b/src/Webpatser/Countries/Models/countries.json index 44fe0e7..3408d9e 100644 --- a/src/Webpatser/Countries/Models/countries.json +++ b/src/Webpatser/Countries/Models/countries.json @@ -1706,7 +1706,7 @@ "citizenship":"Guadeloupean", "country-code":"312", "currency":"euro", - "currency_code":"EUR ", + "currency_code":"EUR", "currency_sub_unit":"cent", "full_name":"Guadeloupe", "iso_3166_2":"GP", @@ -3665,7 +3665,7 @@ "citizenship":"San Marinese", "country-code":"674", "currency":"euro", - "currency_code":"EUR ", + "currency_code":"EUR", "currency_sub_unit":"cent", "full_name":"Republic of San Marino", "iso_3166_2":"SM", From 2e61162b8001091a2396cec7d832f1048ca0f611 Mon Sep 17 00:00:00 2001 From: foo99 Date: Fri, 13 Oct 2017 17:57:18 +0900 Subject: [PATCH 02/14] Add package auto-discovery settings --- composer.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 601056d..9c3a288 100644 --- a/composer.json +++ b/composer.json @@ -36,5 +36,15 @@ "support" : { "source" : "https://github.com/webpatser/laravel-countries", "issues" : "https://github.com/webpatser/laravel-countries/issues" - } + }, + "extra": { + "laravel": { + "providers": [ + "Webpatser\\Countries\\CountriesServiceProvider" + ], + "aliases": { + "Countries": "Webpatser\\Countries\\CountriesFacade" + } + } + } } From b0b64cc19147f01a73eb8768a17192c572c150d5 Mon Sep 17 00:00:00 2001 From: foo99 Date: Fri, 13 Oct 2017 17:57:59 +0900 Subject: [PATCH 03/14] Add alias function --- src/commands/MigrationCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/commands/MigrationCommand.php b/src/commands/MigrationCommand.php index a58e071..30db59e 100644 --- a/src/commands/MigrationCommand.php +++ b/src/commands/MigrationCommand.php @@ -70,6 +70,16 @@ public function fire() } } + /** + * Alias fire method. + * + * @return void + */ + public function handle() + { + $this->fire(); + } + /** * Get the console command options. * From 38c7231abb029fe8b45dc59b33345bc75a3b9721 Mon Sep 17 00:00:00 2001 From: foo99 Date: Fri, 13 Oct 2017 17:59:14 +0900 Subject: [PATCH 04/14] Add check for "deprecated optimization command" --- src/commands/MigrationCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/MigrationCommand.php b/src/commands/MigrationCommand.php index 30db59e..5678bd6 100644 --- a/src/commands/MigrationCommand.php +++ b/src/commands/MigrationCommand.php @@ -53,7 +53,9 @@ public function fire() { $this->line(''); - $this->call('optimize', []); + if (version_compare(app()->version(), '5.5.0', '<')) { + $this->call('optimize', []); + } $this->line(''); From c8772b7102dbb9524424e575c90c0b24f1f64a5b Mon Sep 17 00:00:00 2001 From: foo99 Date: Fri, 13 Oct 2017 17:59:26 +0900 Subject: [PATCH 05/14] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 972e514..0defe6b 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Add `webpatser/laravel-countries` to `composer.json`. Run `composer update` to pull down the latest version of Country List. +**If you're using Laravel 5.5, you don't have to edit `app/config/app.php`.** + Edit `app/config/app.php` and add the `provider` and `filter` 'providers' => [ @@ -38,6 +40,7 @@ You can start by publishing the configuration. This is an optional step, it cont Next generate the migration file: $ php artisan countries:migration + $ composer dump-autoload It will generate the `_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` From dafe6954e05feea78b6ffa52197ec8535ca2d44b Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 14:23:10 -0200 Subject: [PATCH 06/14] Fix: PHP 7.2 E_WARNING about sizeof() --- src/Webpatser/Countries/Countries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Webpatser/Countries/Countries.php b/src/Webpatser/Countries/Countries.php index ca21d19..9ab1f94 100644 --- a/src/Webpatser/Countries/Countries.php +++ b/src/Webpatser/Countries/Countries.php @@ -40,7 +40,7 @@ public function __construct() protected function getCountries() { //Get the countries from the JSON file - if (sizeof($this->countries) == 0){ + if (empty($this->countries)){ $this->countries = json_decode(file_get_contents(__DIR__ . '/Models/countries.json'), true); } From bb0fdcc8270dc8923711809654512dcb38741560 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:23:45 -0200 Subject: [PATCH 07/14] Update composer.json --- composer.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 9c3a288..b7d50a9 100644 --- a/composer.json +++ b/composer.json @@ -36,15 +36,6 @@ "support" : { "source" : "https://github.com/webpatser/laravel-countries", "issues" : "https://github.com/webpatser/laravel-countries/issues" - }, - "extra": { - "laravel": { - "providers": [ - "Webpatser\\Countries\\CountriesServiceProvider" - ], - "aliases": { - "Countries": "Webpatser\\Countries\\CountriesFacade" - } - } + } } } From bc6be318670062b6d5784dbcd451c0b70a0705a2 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:24:16 -0200 Subject: [PATCH 08/14] Update composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index b7d50a9..601056d 100644 --- a/composer.json +++ b/composer.json @@ -37,5 +37,4 @@ "source" : "https://github.com/webpatser/laravel-countries", "issues" : "https://github.com/webpatser/laravel-countries/issues" } - } } From 074c11eba765660d7d2576e2d73820c37154ccc8 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:25:34 -0200 Subject: [PATCH 09/14] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 0defe6b..221a38b 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ Add `webpatser/laravel-countries` to `composer.json`. Run `composer update` to pull down the latest version of Country List. -**If you're using Laravel 5.5, you don't have to edit `app/config/app.php`.** - Edit `app/config/app.php` and add the `provider` and `filter` 'providers' => [ @@ -52,4 +50,4 @@ 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 \ No newline at end of file +After running this command the filled countries table will be available From cbc20283b3a5ce11449effccae30a9bb650fea74 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:26:13 -0200 Subject: [PATCH 10/14] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 221a38b..98377a7 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ You can start by publishing the configuration. This is an optional step, it cont Next generate the migration file: $ php artisan countries:migration - $ composer dump-autoload It will generate the `_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` From fa70f7ea39101c09a9ea0f3eddd2eefb80de9410 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:27:21 -0200 Subject: [PATCH 11/14] Update countries.json --- src/Webpatser/Countries/Models/countries.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Webpatser/Countries/Models/countries.json b/src/Webpatser/Countries/Models/countries.json index 3408d9e..44fe0e7 100644 --- a/src/Webpatser/Countries/Models/countries.json +++ b/src/Webpatser/Countries/Models/countries.json @@ -1706,7 +1706,7 @@ "citizenship":"Guadeloupean", "country-code":"312", "currency":"euro", - "currency_code":"EUR", + "currency_code":"EUR ", "currency_sub_unit":"cent", "full_name":"Guadeloupe", "iso_3166_2":"GP", @@ -3665,7 +3665,7 @@ "citizenship":"San Marinese", "country-code":"674", "currency":"euro", - "currency_code":"EUR", + "currency_code":"EUR ", "currency_sub_unit":"cent", "full_name":"Republic of San Marino", "iso_3166_2":"SM", From c74fcb6ea884d323b68fee143d68bc0f8b37bd5a Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:27:50 -0200 Subject: [PATCH 12/14] Update MigrationCommand.php --- src/commands/MigrationCommand.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/commands/MigrationCommand.php b/src/commands/MigrationCommand.php index 5678bd6..ba74c95 100644 --- a/src/commands/MigrationCommand.php +++ b/src/commands/MigrationCommand.php @@ -72,16 +72,6 @@ public function fire() } } - /** - * Alias fire method. - * - * @return void - */ - public function handle() - { - $this->fire(); - } - /** * Get the console command options. * From a7dc5c16b08a63445ba791f22c5b490939b37052 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:28:19 -0200 Subject: [PATCH 13/14] Update MigrationCommand.php --- src/commands/MigrationCommand.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/commands/MigrationCommand.php b/src/commands/MigrationCommand.php index ba74c95..a58e071 100644 --- a/src/commands/MigrationCommand.php +++ b/src/commands/MigrationCommand.php @@ -53,9 +53,7 @@ public function fire() { $this->line(''); - if (version_compare(app()->version(), '5.5.0', '<')) { - $this->call('optimize', []); - } + $this->call('optimize', []); $this->line(''); From 4eb34fa9ea80674a435eecccb13022b0629f0db1 Mon Sep 17 00:00:00 2001 From: "Mateus Felipe C. C. Pinto" Date: Wed, 3 Jan 2018 16:28:57 -0200 Subject: [PATCH 14/14] Update README.md