From 60883cd1650fa7a52cacd2a7f152eece7291429f Mon Sep 17 00:00:00 2001 From: Tycho Huisman Date: Thu, 13 Mar 2025 11:44:30 +0100 Subject: [PATCH] add cache filename to config --- config.php | 11 +++++++++++ src/Support/ModularServiceProvider.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config.php b/config.php index 95b6dbd..7e45224 100644 --- a/config.php +++ b/config.php @@ -91,4 +91,15 @@ */ 'should_discover_events' => null, + + /* + |-------------------------------------------------------------------------- + | Custom cache filename + |-------------------------------------------------------------------------- + | + | This is the filename of the cache file that will be used to store the modules configuration. + | + */ + + 'cache_filename' => 'modules.php', ]; diff --git a/src/Support/ModularServiceProvider.php b/src/Support/ModularServiceProvider.php index 22120ca..d2c26e4 100644 --- a/src/Support/ModularServiceProvider.php +++ b/src/Support/ModularServiceProvider.php @@ -50,7 +50,7 @@ public function register(): void $this->app->singleton(ModuleRegistry::class, function() { return new ModuleRegistry( $this->getModulesBasePath(), - $this->app->bootstrapPath('cache/modules.php') + $this->app->bootstrapPath('cache/' . config('app-modules.cache_filename', 'modules.php')) ); });