From bfc7401c479371ed2798e5a36a1129b4066ec35c Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Wed, 17 Jul 2024 08:59:43 +0200 Subject: [PATCH] Lumen Context fix (#922) --- .../Laravel/Integration/LaravelContextIntegration.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sentry/Laravel/Integration/LaravelContextIntegration.php b/src/Sentry/Laravel/Integration/LaravelContextIntegration.php index 4231df4d..59a77fd9 100644 --- a/src/Sentry/Laravel/Integration/LaravelContextIntegration.php +++ b/src/Sentry/Laravel/Integration/LaravelContextIntegration.php @@ -2,7 +2,7 @@ namespace Sentry\Laravel\Integration; -use Illuminate\Support\Facades\Context; +use Illuminate\Log\Context\Repository as ContextRepository; use Sentry\Event; use Sentry\EventHint; use Sentry\EventType; @@ -15,7 +15,7 @@ class LaravelContextIntegration implements IntegrationInterface public function setupOnce(): void { // Context was introduced in Laravel 11 so we need to check if we can use it otherwise we skip the event processor - if (!class_exists(Context::class)) { + if (!class_exists(ContextRepository::class)) { return; } @@ -30,7 +30,7 @@ public function setupOnce(): void return $event; } - $event->setContext('laravel', Context::all()); + $event->setContext('laravel', app(ContextRepository::class)->all()); return $event; });