protected function methodNotAllowed(
        Request $request,
        Response $response,
        Route $route
    ) {
        $request;
        $response = $response->withStatus(405)
            ->withHeader('Allow', implode(', ', $route->allows))
            ->withHeader('Content-Type', 'application/json');
        $response->getBody()->write(json_encode($route->allows));
        return $response;
    }