From cb3040e3196c15d0ef032ae49b09ed0bcc24bbfa Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 28 May 2024 19:12:21 +0100 Subject: [PATCH] Fixes missing route context (#51602) --- src/Illuminate/Foundation/Exceptions/Renderer/Exception.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Foundation/Exceptions/Renderer/Exception.php b/src/Illuminate/Foundation/Exceptions/Renderer/Exception.php index 9bb4269825db..52a3ccd4d131 100644 --- a/src/Illuminate/Foundation/Exceptions/Renderer/Exception.php +++ b/src/Illuminate/Foundation/Exceptions/Renderer/Exception.php @@ -164,7 +164,7 @@ public function requestBody() /** * Get the application's route context. * - * @return array|null + * @return array */ public function applicationRouteContext() { @@ -174,7 +174,7 @@ public function applicationRouteContext() 'controller' => $route->getActionName(), 'route name' => $route->getName() ?: null, 'middleware' => implode(', ', $route->gatherMiddleware()), - ]) : null; + ]) : []; } /** @@ -184,7 +184,7 @@ public function applicationRouteContext() */ public function applicationRouteParametersContext() { - $parameters = $this->request()->route()->parameters(); + $parameters = $this->request()->route()?->parameters(); return $parameters ? json_encode(array_map( fn ($value) => $value instanceof Model ? $value->withoutRelations() : $value,