Skip to content

Commit 44d5b7d

Browse files
committed
handle cached closures better
1 parent cbcd568 commit 44d5b7d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Route.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,13 @@ public function controllerPath(): string
129129
$controller = $this->controller();
130130

131131
if ($controller === '\\Closure') {
132-
return $this->relativePath((new ReflectionClosure($this->closure()))->getFileName());
132+
$path = $this->relativePath((new ReflectionClosure($this->closure()))->getFileName());
133+
134+
if (str_contains($path, 'laravel-serializable-closure')) {
135+
return '[serialized-closure]';
136+
}
137+
138+
return $path;
133139
}
134140

135141
if (! class_exists($controller)) {

0 commit comments

Comments
 (0)