This funcionality should be acomplished using "auth" middleware, however I am not sure if order of middlewares matter. For this case I have added one if to this middleware.
This funcionality should be acomplished using "auth" middleware, however I am not sure if order of middlewares matter. For this case I have added one if to this middleware.