From 3bb76e424b4c79b30f63772883eae9d2ad2977a4 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 12 Sep 2024 20:12:21 +0800 Subject: [PATCH] [11.x] Fixed attempt to call `Application::routesAreCached()` when application doesn't implements `CachesRoutes` contract. fixes #52760 Signed-off-by: Mior Muhammad Zaki --- src/Illuminate/Filesystem/FilesystemServiceProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Filesystem/FilesystemServiceProvider.php b/src/Illuminate/Filesystem/FilesystemServiceProvider.php index a6ad8e1a7b34..28fe5f60b23a 100644 --- a/src/Illuminate/Filesystem/FilesystemServiceProvider.php +++ b/src/Illuminate/Filesystem/FilesystemServiceProvider.php @@ -2,6 +2,7 @@ namespace Illuminate\Filesystem; +use Illuminate\Contracts\Foundation\CachesRoutes; use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; @@ -78,7 +79,7 @@ protected function registerManager() */ protected function serveFiles() { - if ($this->app->routesAreCached()) { + if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) { return; }