From dff2ad8e845449cbae1cf271e93fd3b3761433ed Mon Sep 17 00:00:00 2001 From: David Carr Date: Tue, 17 Mar 2026 01:51:37 +0000 Subject: [PATCH] use config instead of env for Vapor maintenance mode check --- config/config.php | 11 +++++++++++ src/Laravel/Module.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/config.php b/config/config.php index 21f165650..669730daf 100644 --- a/config/config.php +++ b/config/config.php @@ -15,6 +15,17 @@ */ 'namespace' => 'Modules', + /* + |-------------------------------------------------------------------------- + | Vapor Maintenance Mode + |-------------------------------------------------------------------------- + | + | Indicates if the application is running on Laravel Vapor. + | When enabled, cached services path will be set to a writable location. + | + */ + 'vapor_maintenance_mode' => env('VAPOR_MAINTENANCE_MODE', false), + /* |-------------------------------------------------------------------------- | Module Stubs diff --git a/src/Laravel/Module.php b/src/Laravel/Module.php index 994bdecf4..e3789b992 100644 --- a/src/Laravel/Module.php +++ b/src/Laravel/Module.php @@ -17,7 +17,7 @@ public function getCachedServicesPath(): string { // This checks if we are running on a Laravel Vapor managed instance // and sets the path to a writable one (services path is not on a writable storage in Vapor). - if (! is_null(env('VAPOR_MAINTENANCE_MODE', null))) { + if (config('modules.vapor_maintenance_mode')) { return Str::replaceLast('config.php', $this->getSnakeName().'_module.php', $this->app->getCachedConfigPath()); }