I am creating a restful api with the framework Slim3
the data is returned to me with json, but to debug I like more to show the answer with a nicer format.
in% pure co_de I do it using
json_encode($datos, JSON_PRETTY_PRINT);
I have the following
$app->get('/ads', function ($request, $response, $args) {
$db = $this->get('db');
$datos = $db->get('ads');
return $this->response->withJson($datos);
});