matteocontrini I think there is a way to access the request via the app container, and therefore via
app(), but this is something we're trying to avoid. Not 100% sure what the reasons behind this architecture are because in Laravel it's pretty much standard to access all global objects out of the container. We have an issue about removing global helpers here flarum/core#1796
The request object is usually available in the events where it makes sense, usually around the HTTP/API parts.
I'm not sure why the post formatter need access to the request, it doesn't seem logical. Given it doesn't interact with the HTTP stack... I have not dived into the source code to check that yet.