Skip to content

Commit

Permalink
Merge pull request #78 from foo99/laravel_5.5
Browse files Browse the repository at this point in the history
Support Laravel 5.5
  • Loading branch information
webpatser committed Oct 15, 2017
2 parents 50e06ee + c8772b7 commit d661881
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand All @@ -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 `<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`

Expand Down
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
14 changes: 13 additions & 1 deletion src/commands/MigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('');

Expand All @@ -70,6 +72,16 @@ public function fire()
}
}

/**
* Alias fire method.
*
* @return void
*/
public function handle()
{
$this->fire();
}

/**
* Get the console command options.
*
Expand Down

0 comments on commit d661881

Please sign in to comment.