Skip to content

Commit

Permalink
Fixes missing route context (#51602)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro authored May 28, 2024
1 parent af8a8f6 commit cb3040e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Foundation/Exceptions/Renderer/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function requestBody()
/**
* Get the application's route context.
*
* @return array<string, string>|null
* @return array<string, string>
*/
public function applicationRouteContext()
{
Expand All @@ -174,7 +174,7 @@ public function applicationRouteContext()
'controller' => $route->getActionName(),
'route name' => $route->getName() ?: null,
'middleware' => implode(', ', $route->gatherMiddleware()),
]) : null;
]) : [];
}

/**
Expand All @@ -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,
Expand Down

0 comments on commit cb3040e

Please sign in to comment.