Skip to content

Commit

Permalink
lara 11 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dipeshsukhia committed Mar 24, 2024
1 parent 62e70ad commit 7f65a1d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ php artisan country-data:install
### Requirements

``` bash
Laravel 5.8.x, 6.x, 7.x, 8.x, 9.x, 10.x
Laravel 5.8.x, 6.x, 7.x, 8.x, 9.x, 10.x, 11.x
PHP >= 7.1.3 or Grater
```

Expand Down
13 changes: 3 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@
],
"require": {
"php": ">=7.1.3",
"illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0"
"illuminate/support": "^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0"
},
"require-dev": {
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^9.0|^10.0"
"phpunit/phpunit": "^9.0|^10.5"
},
"autoload": {
"psr-4": {
Expand All @@ -49,18 +48,12 @@
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
},
"minimum-stability": "stable",
"extra": {
"laravel": {
"providers": [
"DipeshSukhia\\LaravelCountryStateCityData\\LaravelCountryStateCityDataServiceProvider"
],
"aliases": {
"LaravelCountryStateCityData": "DipeshSukhia\\LaravelCountryStateCityData\\LaravelCountryStateCityDataFacade"
}
]
}
}
}
8 changes: 0 additions & 8 deletions src/LaravelCountryStateCityData.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/LaravelCountryStateCityDataFacade.php

This file was deleted.

6 changes: 3 additions & 3 deletions src/LaravelCountryStateCityDataServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function boot()
}

foreach (['Country', 'State', 'City'] as $modelName) {
$ModelTemplate = self::getStubContents("Models/" . $modelName . ".stub");
$ModelTemplate = $this->getStubContents( "Models/" . $modelName . ".stub");
$ModelTemplate = str_replace('{{modelNameSpace}}', $modelNameSpace, $ModelTemplate);
file_put_contents($modelDir . "/" . $modelName . ".php", $ModelTemplate);
}
Expand All @@ -41,7 +41,7 @@ public function boot()
$seedDir = database_path('seeders');
$seederNameSpace = "namespace Database\\Seeders;\n";
}
$seederTemplate = self::getStubContents('seeders/CountryStateCityTableSeeder.stub');
$seederTemplate = $this->getStubContents('seeders/CountryStateCityTableSeeder.stub');
$seederTemplate = str_replace('{{seederNameSpace}}', $seederNameSpace, $seederTemplate);
$seederTemplate = str_replace('{{modelNameSpace}}', $modelNameSpace, $seederTemplate);
file_put_contents($seedDir . '/CountryStateCityTableSeeder.php', $seederTemplate);
Expand Down Expand Up @@ -71,7 +71,7 @@ public function register()
//
}

private function getStubContents($stubName)
private function getStubContents( string $stubName )
{
return file_get_contents(self::STUB_DIR . $stubName);
}
Expand Down

0 comments on commit 7f65a1d

Please sign in to comment.