How to tell if a request is made to the API routes
Hi,
so I'm trying to implement the render method of an Exception, but since I use the exception in both api routes and stateful routes, I need to be able to tell if it's api or not.
I could just check the first segment of the URL, but seems hacky. Maybe there's a way to check if the request went through api middleware? Or anything even more straightforward?