Skip to content

[13.x] Restore the container instance after route:cache boots a fresh application - #61405

Merged
taylorotwell merged 2 commits into
laravel:13.xfrom
lazerg:fix/issue-61401-route-cache-container-instance
Sep 2, 2026
Merged

[13.x] Restore the container instance after route:cache boots a fresh application#61405
taylorotwell merged 2 commits into
laravel:13.xfrom
lazerg:fix/issue-61401-route-cache-container-instance

Conversation

@lazerg

@lazerg lazerg commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

getFreshApplication() boots a throwaway application, and Application::__construct points Container::getInstance() at it. Since #61346 the facade application is restored afterwards but the container instance is not, so app() and Container::getInstance() keep resolving out of the discarded application while facades resolve out of the live one. Under optimize that breaks view:cache, which runs right after route:cache in the same process and builds the Blade engine from the container.

This restores the container instance alongside the facade application. On 13.29 both pointed at the throwaway application, so the split only appeared in 13.30.

Fixes #61401

@taylorotwell
taylorotwell merged commit cd62d92 into laravel:13.x Sep 2, 2026
53 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Facades and the container instance point to different applications after route:cache

2 participants