Middleware is like a guard in Laravel. It added custom authentication or conditions if used before the controller & it added some data to response if used after the controller.
![](https://dilip-parmar.in/wp-content/uploads/2023/04/Middleware-1.png)
![](https://dilip-parmar.in/wp-content/uploads/2023/04/Middleware-2.png)
Middleware is like a guard in Laravel. It added custom authentication or conditions if used before the controller & it added some data to response if used after the controller.