Slim-4.5 skeleton app with Slim-http response decorator

I’ve started to build an API using the slim-skeleton app and everything works great.

Now I want to respond with a file instead of JSON, but I don’t have a clue how to integrate / use the slim-http response decorator in order to use $response->withFileDownload(…)

UPDATE (RESOLUTION)

  • included slim/http package (through composer) and the response type is already changed into Slim\Http\Response
  • changed the Response object in all Actions, from use Psr\Http\Message\ResponseInterface as Response to use Slim\Http\Response

Now I have decorators !