[00:00] Laravel tip how to assign a middleware to specific methods in controller. Did you know that there's a method called middleware4 that you can add in the routes? For the method show, we have middleware [00:12] of can view blog. For a few more methods, we have auth and verified. But in my opinion, this code in the routes is pretty hard to read. Here are more readable examples in Laravel docs of middleware4 [00:25] for one method, I do agree, but if I have four middleware for lines, personally, instead, I would move the logic to gates and policies outside of routes. But also, you can put that logic in the [00:37] controller. So, here's an example from the docs. You may specify that controller implements has middleware, and then provide the array of middlewares for all controller, or only for specific [00:49] methods. In Laravel 10 and older, the syntax was this middleware in the constructor of controller. For more tips and longer videos, subscribe to my YouTube channel Laravel Daily.