Skip to content

Commit 8431838

Browse files
author
Andrey Helldar
committed
Added Laravel 9 support
1 parent 67bff4a commit 8431838

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
],
1717
"require": {
1818
"php": "^7.2|^8.0",
19-
"illuminate/container": "^6.0|^7.0|^8.0",
20-
"illuminate/database": "^6.0|^7.0|^8.0",
21-
"illuminate/http": "^6.0|^7.0|^8.0",
22-
"illuminate/support": "^6.0|^7.0|^8.0",
19+
"illuminate/container": "^6.0|^7.0|^8.0|^9.0",
20+
"illuminate/database": "^6.0|^7.0|^8.0|^9.0",
21+
"illuminate/http": "^6.0|^7.0|^8.0|^9.0",
22+
"illuminate/support": "^6.0|^7.0|^8.0|^9.0",
2323
"ramsey/uuid": "^3.7|^4.0",
24-
"symfony/var-dumper": "^4.0|^5.0"
24+
"symfony/var-dumper": "^4.0|^5.0|6.0"
2525
},
2626
"require-dev": {
27-
"laravel/framework": "^6.0|^7.0|^8.0",
28-
"laravel/lumen-framework": "^6.0|^7.0|^8.0"
27+
"laravel/framework": "^6.0|^7.0|^8.0|^9.0",
28+
"laravel/lumen-framework": "^6.0|^7.0|^8.0|^9.0"
2929
},
3030
"conflict": {
3131
"andrey-helldar/laravel-support": "*"

src/Facades/AppVersion.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @method static bool is6x()
1212
* @method static bool is7x()
1313
* @method static bool is8x()
14+
* @method static bool is9x()
1415
*/
1516
class AppVersion extends Facade
1617
{

src/Support/AppVersion.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public function is8x(): bool
2525
return $this->major() === 8;
2626
}
2727

28+
public function is9x(): bool
29+
{
30+
return $this->major() === 9;
31+
}
32+
2833
protected function major(): int
2934
{
3035
return (int) Str::before($this->version(), '.');
@@ -33,12 +38,9 @@ protected function major(): int
3338
protected function version(): string
3439
{
3540
if (AppHelper::isLumen()) {
36-
$version = app()->version();
37-
38-
$version = Str::after($version, '(');
39-
$version = Str::before($version, ')');
41+
preg_match('/.+\((\d+\.\d+\.\d+)\)/', app()->version(), $matches);
4042

41-
return $version;
43+
return $matches[1];
4244
}
4345

4446
return Application::VERSION;

0 commit comments

Comments
 (0)