flushStalePackageManifest(); } /** * Remove the compiled package/service manifests. They were already loaded * into memory for this request, so deleting them here is safe and simply * forces Laravel to recompile them (without php-mcp) on the next request. */ private function flushStalePackageManifest(): void { foreach (['packages.php', 'services.php'] as $file) { $path = $this->app->bootstrapPath('cache/'.$file); if (! is_file($path)) { continue; } if (! @unlink($path)) { // The app still boots (this provider is a harmless no-op), but a // non-writable bootstrap/cache means the stale manifest -- and this // shim -- persist on every request, so surface it for operators. // Logging must never break boot, hence the guard. try { Log::warning("Leantime: could not delete stale package manifest {$path}; check bootstrap/cache permissions."); } catch (\Throwable) { // no-op } } } } }