From 392c7bcf7526e905e241236d368d589dab8e712e Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Wed, 20 Mar 2024 11:18:45 +1000 Subject: [PATCH] Fix adding multiple bootstrap providers with opcache --- src/Illuminate/Support/ServiceProvider.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Illuminate/Support/ServiceProvider.php b/src/Illuminate/Support/ServiceProvider.php index 06eb0ddba418..8fa295563b4f 100755 --- a/src/Illuminate/Support/ServiceProvider.php +++ b/src/Illuminate/Support/ServiceProvider.php @@ -493,6 +493,10 @@ public static function addProviderToBootstrapFile(string $provider, string $path return false; } + if (function_exists('opcache_invalidate')) { + opcache_invalidate($path, true); + } + $providers = collect(require $path) ->merge([$provider]) ->unique()