From 1d75e57e7c4befb5d17a3a717220ce06bf76e6d2 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 7 Dec 2023 10:16:44 +0800 Subject: [PATCH] [10.x] `Route::getController()` should return `null` when the accessing closure based route fixes #49267 Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Routing/Route.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Illuminate/Routing/Route.php b/src/Illuminate/Routing/Route.php index 886d85165f04..7664500784f8 100755 --- a/src/Illuminate/Routing/Route.php +++ b/src/Illuminate/Routing/Route.php @@ -268,6 +268,10 @@ protected function runController() */ public function getController() { + if (! $this->isControllerAction()) { + return null; + } + if (! $this->controller) { $class = $this->getControllerClass();