Skip to content

Commit

Permalink
Merge pull request #97 from scoutapp/laravel-11-support
Browse files Browse the repository at this point in the history
Widen composer compatibility to include Laravel 11
  • Loading branch information
asgrim authored Jun 10, 2024
2 parents 29d0f63 + b3f9eae commit 8c9624f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/validate-composer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- "8.*"
- "9.*"
- "10.*"
- "11.*"
php-version:
- "7.2"
- "7.3"
Expand All @@ -27,7 +28,7 @@ jobs:
- "8.2"
- "8.3"
exclude:
# See - https://laravel.com/docs/9.x/releases#support-policy
# See - https://laravel.com/docs/11.x/releases#support-policy
# See - https://github.com/laravel/framework/issues/40339
# Laravel 5.5 supports PHP 7.1 - 7.4
- {laravel-version: "5.5.*", php-version: "8.0"} # Laravel 5.5.* does not support PHP 8.0+
Expand All @@ -51,13 +52,19 @@ jobs:
- {laravel-version: "9.*", php-version: "7.3"} # Laravel 9 requires 8.0+
- {laravel-version: "9.*", php-version: "7.4"} # Laravel 9 requires 8.0+
- {laravel-version: "9.*", php-version: "8.3"} # Laravel 9 does not support PHP 8.3+
# Laravel 10 supports PHP 8.1 - 8.2 @todo tbc
# Laravel 10 supports PHP 8.1 - 8.3
- {laravel-version: "10.*", php-version: "7.2"} # Laravel 10 requires 8.1+
- {laravel-version: "10.*", php-version: "7.3"} # Laravel 10 requires 8.1+
- {laravel-version: "10.*", php-version: "7.4"} # Laravel 10 requires 8.1+
- {laravel-version: "10.*", php-version: "8.0"} # Laravel 10 requires 8.1+
# Laravel 11 supports PHP 8.2 - 8.3
- {laravel-version: "11.*", php-version: "7.2"} # Laravel 11 requires 8.2+
- {laravel-version: "11.*", php-version: "7.3"} # Laravel 11 requires 8.2+
- {laravel-version: "11.*", php-version: "7.4"} # Laravel 11 requires 8.2+
- {laravel-version: "11.*", php-version: "8.0"} # Laravel 11 requires 8.2+
- {laravel-version: "11.*", php-version: "8.1"} # Laravel 11 requires 8.2+
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,30 @@ $config[\Scoutapm\Config\ConfigKey::LOG_LEVEL] = \Psr\Log\LogLevel::ERROR;

Any of the constants defined in `\Psr\Log\LogLevel` are acceptable values for this configuration option.

### Laravel 11 Error Handling

In Laravel 11, the `App\Exceptions\Handler` approach has been retired, and a new method `withExceptions()` has been
added in `bootstrap/app.php` when configuring the application. In order for Scout APM Error Handling to pick up
uncaught exceptions, you should add the appropriate Scout APM call, for example:

```php
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {
// ...
})
->withExceptions(function (Exceptions $exceptions) {
// Add the following call to enable uncaught exceptions in Scout APM error reporting:
$exceptions->reportable(function (Throwable $e) {
app()->make(\Scoutapm\ScoutApmAgent::class)->recordThrowable($e);
});
})->create();
```

## Documentation

For full installation and troubleshooting documentation, visit our [help site](https://docs.scoutapm.com/#laravel).
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"development"
],
"require": {
"illuminate/contracts": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/http": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/routing": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/support": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/view": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0",
"illuminate/contracts": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/http": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/routing": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/view": "^5.5.0|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"scoutapp/scout-apm-php": "^8.0"
},
"config": {
Expand Down

0 comments on commit 8c9624f

Please sign in to comment.