Skip to content

Commit 07dfefe

Browse files
authored
Add support for Laravel 9 (#534)
1 parent 053baa4 commit 07dfefe

File tree

4 files changed

+30
-10
lines changed

4 files changed

+30
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ jobs:
3434

3535
# All versions below only support PHP ^7.3 (Laravel requirement)
3636
- { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }
37+
38+
# All versions below only support PHP ^8.0 (Laravel requirement)
39+
- { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
3740
exclude:
41+
- php: "7.2"
42+
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
43+
- php: "7.3"
44+
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
45+
- php: "7.4"
46+
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
47+
3848
- php: "7.2"
3949
packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }
4050

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
- Add support for Laravel 9 (#534)
6+
- Fix double wrapping the log channel in a `FingersCrossedHandler` on Laravel `v8.97` and newer when `action_level` option is set on the Log channel config (#534)
7+
58
## 2.10.2
69

710
- Fix `sentry:test` command not having correct exit code on success

composer.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@
2222
],
2323
"require": {
2424
"php": "^7.2 | ^8.0",
25-
"illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0",
25+
"illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
2626
"sentry/sentry": "^3.3",
2727
"sentry/sdk": "^3.1",
2828
"symfony/psr-http-message-bridge": "^1.0 | ^2.0",
2929
"nyholm/psr7": "^1.0"
3030
},
31+
"autoload": {
32+
"psr-0": {
33+
"Sentry\\Laravel\\": "src/"
34+
}
35+
},
3136
"suggest": {
3237
"zendframework/zend-diactoros": "When using Laravel >=5.1 - <=6.9 this package can help get more accurate request info, not used on Laravel >=6.10 anymore (https://laravel.com/docs/5.8/requests#psr7-requests)"
3338
},
3439
"require-dev": {
3540
"phpunit/phpunit": "^5.7 | ^6.5 | ^7.5 | ^8.4 | ^9.3",
36-
"laravel/framework": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0",
37-
"orchestra/testbench": "3.1 - 3.8 | ^4.7 | ^5.1 | ^6.0",
41+
"laravel/framework": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
42+
"orchestra/testbench": "3.1 - 3.8 | ^4.7 | ^5.1 | ^6.0 | ^7.0",
3843
"friendsofphp/php-cs-fixer": "2.18.*",
39-
"mockery/mockery": "1.3.*"
40-
},
41-
"autoload": {
42-
"psr-0": {
43-
"Sentry\\Laravel\\": "src/"
44-
}
44+
"mockery/mockery": "^1.3"
4545
},
4646
"autoload-dev": {
4747
"psr-4": {
@@ -76,5 +76,7 @@
7676
"Sentry": "Sentry\\Laravel\\Facade"
7777
}
7878
}
79-
}
79+
},
80+
"prefer-stable": true,
81+
"minimum-stability": "dev"
8082
}

src/Sentry/Laravel/LogChannel.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public function __invoke(array $config): Logger
2626

2727
if (isset($config['action_level'])) {
2828
$handler = new FingersCrossedHandler($handler, $config['action_level']);
29+
30+
// Consume the `action_level` config option since newer Laravel versions also support this option
31+
// and will wrap the handler again in another `FingersCrossedHandler` if we leave the option set
32+
// See: https://github.com/laravel/framework/pull/40305 (release v8.79.0)
33+
unset($config['action_level']);
2934
}
3035

3136
return new Logger(

0 commit comments

Comments
 (0)