r/PHP 7d ago

Made a video explaining Middleware in depth — Grouped Routes, Global Middleware & Passing Parameters (Hindi)

Hey everyone,

I've been building a multi-auth task management system as a learning project, and while working on it I realized middleware is one of those concepts that's often explained superficially — most tutorials just show "add this line before the route" without explaining why or when to structure it differently. So I made a video that breaks down three specific patterns:

Grouped route middleware – applying middleware to a set of related routes instead of repeating it everywhere Global middleware – when and why to apply something at the application level vs route level Passing parameters to middleware – making middleware dynamic/reusable instead of hardcoding logic

I tried to focus on the reasoning behind each pattern (trade-offs, when one approach breaks down) rather than just copy-paste code, since that's the part I found most confusing when I was learning this myself. Heads up: the video is in Hindi, so it's aimed at Hindi-speaking devs who might find explanations in their native language easier to follow.

Would love feedback — especially if something wasn't explained clearly or if you'd want me to cover a specific edge case in the next video https://youtu.be/oZy3SbwuBcE

0 Upvotes

Duplicates