Skip to content

Add support for Laravel 9 #534

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 7 commits into from
Jan 13, 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
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ jobs:

# All versions below only support PHP ^7.3 (Laravel requirement)
- { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }

# All versions below only support PHP ^8.0 (Laravel requirement)
- { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
exclude:
- php: "7.2"
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
- php: "7.3"
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }
- php: "7.4"
packages: { laravel: ^9.0, testbench: ^7.0, phpunit: 9.5.* }

- php: "7.2"
packages: { laravel: ^8.0, testbench: ^6.0, phpunit: 9.3.* }

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Add support for Laravel 9 (#534)
- 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)

## 2.10.2

- Fix `sentry:test` command not having correct exit code on success
Expand Down
22 changes: 12 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@
],
"require": {
"php": "^7.2 | ^8.0",
"illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0",
"illuminate/support": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
"sentry/sentry": "^3.3",
"sentry/sdk": "^3.1",
"symfony/psr-http-message-bridge": "^1.0 | ^2.0",
"nyholm/psr7": "^1.0"
},
"autoload": {
"psr-0": {
"Sentry\\Laravel\\": "src/"
}
},
"suggest": {
"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)"
},
"require-dev": {
"phpunit/phpunit": "^5.7 | ^6.5 | ^7.5 | ^8.4 | ^9.3",
"laravel/framework": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0",
"orchestra/testbench": "3.1 - 3.8 | ^4.7 | ^5.1 | ^6.0",
"laravel/framework": "5.0 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0",
"orchestra/testbench": "3.1 - 3.8 | ^4.7 | ^5.1 | ^6.0 | ^7.0",
"friendsofphp/php-cs-fixer": "2.18.*",
"mockery/mockery": "1.3.*"
},
"autoload": {
"psr-0": {
"Sentry\\Laravel\\": "src/"
}
"mockery/mockery": "^1.3"
},
"autoload-dev": {
"psr-4": {
Expand Down Expand Up @@ -76,5 +76,7 @@
"Sentry": "Sentry\\Laravel\\Facade"
}
}
}
},
"prefer-stable": true,
"minimum-stability": "dev"
}
5 changes: 5 additions & 0 deletions src/Sentry/Laravel/LogChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ public function __invoke(array $config): Logger

if (isset($config['action_level'])) {
$handler = new FingersCrossedHandler($handler, $config['action_level']);

// Consume the `action_level` config option since newer Laravel versions also support this option
// and will wrap the handler again in another `FingersCrossedHandler` if we leave the option set
// See: https://github.com/laravel/framework/pull/40305 (release v8.79.0)
unset($config['action_level']);
}

return new Logger(
Expand Down