Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for unsigned route closures #45527

Closed
wants to merge 1 commit into from

Conversation

olivernybroe
Copy link
Contributor

Add support for serializing closures in routes unsigned.

This PR depends on the work created in laravel/serializable-closure#62.

The reasoning below is a copy/paste from the other pr.

Why?

When caching routes in the Laravel/framework, they are currently being cached signed. This means if you cache your routes and then set/change your APP_KEY your route caches are invalid.

This option allows the route caching logic to disable signing when caching the routes, which then means APP_KEY can be changed without the route caching being invalid.

Usecase

When building a docker image it is currently impossible to cache your routes while building the image (if any routes are closures) as the APP_KEY should not be exposed to the build steps of the docker image.

Caching the routes while building the image has a lot of advantages, as each instance does not have to cache it themselves. This can also prevent potential crashes of running out of storage when using k8s, as you cannot guarantee the amount of storage available outside of the image size unless you start mounting volumes etc.

@nunomaduro
Copy link
Member

nunomaduro commented Jan 5, 2023

I will re-open this pull request, eventually, if we merge the serializable closure one. To keep the discussing there. 👍🏻

@nunomaduro nunomaduro closed this Jan 5, 2023
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.

2 participants