Skip to content

Commit

Permalink
Merge pull request #10 from TheDragonCode/3.x
Browse files Browse the repository at this point in the history
Laravel 9 support
  • Loading branch information
Andrey Helldar committed Jan 17, 2022
2 parents 67bff4a + 3b56f65 commit de1d2d3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 26 deletions.
50 changes: 29 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,48 @@
{
"name": "dragon-code/laravel-support",
"description": "Various helper files for the Laravel and Lumen frameworks",
"type": "library",
"license": "MIT",
"keywords": ["support", "laravel", "lumen", "framework", "dragon-code", "dragon", "andrey-helldar"],
"support": {
"issues": "https://github.com/TheDragonCode/laravel-support/issues",
"source": "https://github.com/TheDragonCode/laravel-support"
},
"type": "library",
"keywords": [
"support",
"laravel",
"lumen",
"framework",
"dragon-code",
"dragon",
"andrey-helldar"
],
"authors": [
{
"name": "Andrey Helldar",
"email": "[email protected]"
}
],
"support": {
"issues": "https://github.com/TheDragonCode/laravel-support/issues",
"source": "https://github.com/TheDragonCode/laravel-support"
},
"require": {
"php": "^7.2|^8.0",
"illuminate/container": "^6.0|^7.0|^8.0",
"illuminate/database": "^6.0|^7.0|^8.0",
"illuminate/http": "^6.0|^7.0|^8.0",
"illuminate/support": "^6.0|^7.0|^8.0",
"ramsey/uuid": "^3.7|^4.0",
"symfony/var-dumper": "^4.0|^5.0"
"php": "^7.2 || ^8.0",
"illuminate/container": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"illuminate/http": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"ramsey/uuid": "^3.7 || ^4.0",
"symfony/var-dumper": "^4.0 || ^5.0 || 6.0"
},
"require-dev": {
"laravel/framework": "^6.0|^7.0|^8.0",
"laravel/lumen-framework": "^6.0|^7.0|^8.0"
"laravel/framework": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"laravel/lumen-framework": "^6.0 || ^7.0 || ^8.0 || ^9.0"
},
"conflict": {
"andrey-helldar/laravel-support": "*"
},
"suggest": {
"symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers"
},
"minimum-stability": "stable",
"prefer-stable": true,
"autoload": {
"psr-4": {
"DragonCode\\LaravelSupport\\": "src"
Expand All @@ -38,13 +51,8 @@
"helpers/dumper.php"
]
},
"suggest": {
"symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers"
},
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "stable",
"prefer-stable": true
}
}
1 change: 1 addition & 0 deletions src/Facades/AppVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* @method static bool is6x()
* @method static bool is7x()
* @method static bool is8x()
* @method static bool is9x()
*/
class AppVersion extends Facade
{
Expand Down
12 changes: 7 additions & 5 deletions src/Support/AppVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function is8x(): bool
return $this->major() === 8;
}

public function is9x(): bool
{
return $this->major() === 9;
}

protected function major(): int
{
return (int) Str::before($this->version(), '.');
Expand All @@ -33,12 +38,9 @@ protected function major(): int
protected function version(): string
{
if (AppHelper::isLumen()) {
$version = app()->version();

$version = Str::after($version, '(');
$version = Str::before($version, ')');
preg_match('/.+\((\d+\.\d+\.\d+)\)/', app()->version(), $matches);

return $version;
return $matches[1];
}

return Application::VERSION;
Expand Down

0 comments on commit de1d2d3

Please sign in to comment.