English: In Laravel, middleware are filters that run before or after a request hits your application. The Kernel is the place where Laravel manages these middleware. It is like a traffic controller.
๐ธ Hindi: Laravel เคฎเฅเค middleware เคตเฅ filters เคนเฅเคคเฅ เคนเฅเค เคเฅ เคเคฟเคธเฅ request เคเฅ เคเคจเฅ เคธเฅ เคชเคนเคฒเฅ เคฏเคพ response เคญเฅเคเคจเฅ เคธเฅ เคชเคนเคฒเฅ เคเคฒเคคเฅ เคนเฅเคเฅค Middleware Kernel เคตเคน เคเคเคน เคนเฅ เคเคนเคพเค Laravel เคฏเคน เคคเคฏ เคเคฐเคคเคพ เคนเฅ เคเคฟ เคเฅเคจ-เคเฅเคจ เคธเฅ middleware เคเคฌ เคเคฐ เคเคนเคพเค เคเคฒเฅเคเคเฅเฅค
โ Real-World Example (Simple Use Case):
Imagine you’re building a school management system.
- You want every route to check for maintenance mode โ use global middleware
- Your web routes need session and CSRF protection โ use
web
group in middleware kernel - Your API routes should be rate-limited โ use
api
group - A route like
/admin
should be accessible only if the user is admin โ use route middleware likeadmin