I can't see why not. I am using middleware to get localization language and it works perfectly.
Also this sentence in docs proves that middleware can be used for tasks other than filtering requests.
Of course, middleware can be written to perform a variety of tasks besides authentication. A CORS middleware might be responsible for adding the proper headers to all responses leaving your application. A logging middleware might log all incoming requests to your application.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community