Skip to content

Laravel 9 support #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "helldar@ai-rus.com"
}
],
"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