environment('testing') || ! self::isInstalled()) { return; } try { // `route:cache` 도 새 Application 을 부팅하며 전역 Container 인스턴스를 그 일회용 앱으로 // 바꿔 놓는다(`config:cache` 와 동일). 되돌리지 않으면 이 뒤에 등록되는 // `app()->terminating()` 이 종료되지 않는 앱에 걸려 실행되지 않는다 — 단독 실행 // `core:execute-upgrade-steps` 가 라우트 재생성 뒤에 확장 캐시 버전을 올리므로 그 // 재게시 예약이 그렇게 사라졌다 (2026-09-06 전수조사). ConfigCacheHelper::withPreservedContainer(static fn () => Artisan::call('route:cache')); } catch (\Throwable $e) { Log::warning('라우트 캐시 재생성 실패 (route:clear 로 stale 은 제거됨 — 다음 요청은 비캐시 부팅)', [ 'error' => $e->getMessage(), ]); } } /** * 라우트 캐시만 제거합니다 (재생성 없음). * * 재생성이 부적절한 특수 경로(예: 코어 업데이트 흐름 중간 — vendor 교체 중 상태를 * 캐시에 구울 수 없다)를 위한 보조 진입점. * * @return void */ public static function clear(): void { Artisan::call('route:clear'); } /** * G7 설치 완료 여부를 확인합니다. * * @return bool 설치 완료 시 true */ private static function isInstalled(): bool { if (config('app.installer_completed')) { return true; } return file_exists(storage_path('app/g7_installed')); } }