Skip to content

Switch app over to the 'modern' ways of auto-detecting middleware - #19647

Open
uberbrady wants to merge 1 commit into
developfrom
change_middleware_autoloading
Open

uberbrady wants to merge 1 commit into
developfrom
change_middleware_autoloading

Conversation

@uberbrady

Copy link
Copy Markdown
Member

So, this is allegedly the 'new' way that you're supposed to define your Middleware. I've been annoyed that, as we upgrade Laravel versions, we don't necessarily end up automagically getting the latest new Middleware stuff unless we add it in, by hand. For me, this just happened with the new Background Queue feature for Laravel. But I think @spencerrlongg got bit by this as well, when it came to something having to do with route-model-binding, maybe? So, I asked Claude to help me 'migrate' our middleware stacks and whatnot to whatever the 'modern' way is, and this is what it came up with.

It took a pretty conservative approach, which I think I'm mostly OK with - it notes its reasoning in the comments which all do make sense to me.

I have different changes to come that have to do with the Trusted Proxies headers, but those can be handled separately; this should be a true-ish translation of what-we-have-now into the 'modern' way, so that as we continue to upgrade Laravel versions, we should get whatever the newest middleware is supposed to be.

@uberbrady
uberbrady requested a review from snipe as a code owner September 14, 2026 15:36
@codacy-production

codacy-production Bot commented Sep 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@uberbrady
uberbrady force-pushed the change_middleware_autoloading branch from b165652 to 168db7a Compare September 14, 2026 16:02
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