Skip to content

Exclude excluded middleware from global stack #32402

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

Closed
wants to merge 2 commits into from
Closed

Exclude excluded middleware from global stack #32402

wants to merge 2 commits into from

Conversation

nmokkenstorm
Copy link
Contributor

@nmokkenstorm nmokkenstorm commented Apr 16, 2020

This PR aims to fix issue #32384, and is supplementary to PR #32347 by @dsazup , after discussion with @driesvints . I should've marked it as draft for reasons outlined below, but Github won't let me to that after the fact.

At time of writing global middleware doesn't support access to route names, because the route matching process is done after the global middleware stack has run. As a result, accessing the current route on Illuminate\Foundation\Http\Kernel works for terminable (global) middleware, but not for regular middleware.

I've moved the global middleware stack check to its own method, and manually match there now, but obviously there's a performance consideration there. The obvious solution is marking the findRoute method of Illuminate\Routing\Router as public and caching the actual lookup, but that'd be a breaking change in the contract. I'm open for thoughts on this.

@GrahamCampbell
Copy link
Member

Please base your PR off of the 7.x branch. :)

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