Skip to content

Commit 9855ed6

Browse files
committed
Clone router prior to dispatching Laravel request.
This is a short-term fix and needs a little more investigation into possible performance issues with cloning the router before every dispatch. This is probably something that could be done primarily for the dispatcher or even re-work the internal dispatcher so that it doesn't even utilzie the actual Laravel router but instead uses its own. Reference issue dingo#964 and dingo#966.
1 parent b0e945b commit 9855ed6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Routing/Adapter/Laravel.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ public function dispatch(Request $request, $version)
7777

7878
$this->router->setRoutes($routes);
7979

80-
return $this->router->dispatch($request);
80+
$router = clone $this->router;
81+
82+
$response = $router->dispatch($request);
83+
84+
unset($router);
85+
86+
return $response;
8187
}
8288

8389
/**

0 commit comments

Comments
 (0)