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

fix #998 : prevent caching of route callbacks #1002

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vorban
Copy link

@vorban vorban commented Jan 17, 2025

This addresses #998 .

Before: php artisan route:cache serializes through reflection the route callbacks, hardwiring the execution context's absolute path to flux's asset files (ex: /Users/vorban/repositories/...) because of __DIR__ resolution.

After: php artisan route:cache serializes references to the route actions, preventing any resolution of __DIR__ before runtime.

I've tested it locally. The routes are listed by artisan route:list, and artisan route:cache correctly serialized references to the functions.

After a route:cache, going to any page that uses the blade directives like @fluxStyles works and the files are correctly fetched.

I'd prefer this to be thoroughly reviewed, as I failed to find the contribution guidelines and test suites to run.

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.

1 participant