We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb3a048 commit 2818b65Copy full SHA for 2818b65
app/Audit/AuditEventListener.php
@@ -99,11 +99,17 @@ private function buildAuditContext(): AuditContext
99
//$ui = app()->bound('ui.context') ? app('ui.context') : [];
100
101
$req = request();
102
-
103
- $route = Route::getRoutes()->match($req);
104
- $method = $route->methods[0] ?? 'UNKNOWN';
105
- $rawRoute = $method . self::ROUTE_METHOD_SEPARATOR . $route->uri;
106
+
+ try {
+ $route = Route::getRoutes()->match($req);
+ $method = $route->methods[0] ?? 'UNKNOWN';
+ $rawRoute = $method . self::ROUTE_METHOD_SEPARATOR . $route->uri;
107
+ }
108
+ catch (\Exception $e) {
109
+ Log::warning($e);
110
+ $rawRoute = null;
111
112
113
return new AuditContext(
114
userId: $member?->getId(),
115
userEmail: $member?->getEmail(),
0 commit comments