diff --git a/src/RapidezStatamicServiceProvider.php b/src/RapidezStatamicServiceProvider.php index d2ae57a..82d2b66 100644 --- a/src/RapidezStatamicServiceProvider.php +++ b/src/RapidezStatamicServiceProvider.php @@ -2,6 +2,7 @@ namespace Rapidez\Statamic; +use Illuminate\Foundation\Bootstrap\BootProviders; use Illuminate\Routing\Router; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Event; @@ -49,6 +50,11 @@ public function register() $router = app(Router::class); $router->pushMiddlewareToGroup('web', StaticCache::class); }); + $this->app->afterBootstrapping(BootProviders::class, function () { + // Prevent infinite locks by removing the static cache from the statamic.web middleware. + $router = app(Router::class); + $router->removeMiddlewareFromGroup('statamic.web', StaticCache::class); + }); } public function boot()