public function dispatch(Request $request, Response $response, $args) { $this->logger->info("Secteur page action dispatched"); $data = Secteur::all(); $response = $response->withJson($data->toArray()); $response = $response->withStatus(200); return $response; }