From 9ebbf2cecc95e408754262ea4a73d14d1fdb7ab4 Mon Sep 17 00:00:00 2001 From: koogua Date: Fri, 16 Sep 2022 18:44:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96router=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.php b/config/routes.php index a8c49855..c23dac3f 100644 --- a/config/routes.php +++ b/config/routes.php @@ -25,7 +25,7 @@ foreach ($modules as $module) { $moduleName = ucfirst($module); $files = scandir(app_path('Http/' . $moduleName . '/Controllers')); foreach ($files as $file) { - if (strpos($file, 'Controller.php')) { + if (preg_match('/^\w+Controller\.php$/', $file)) { $className = str_replace('Controller.php', '', $file); $router->addModuleResource($module, 'App\Http\\' . $moduleName . '\Controllers\\' . $className); }