protected function getMiddleware(ResourcePath $path)
    {
        $classMiddleware = $this->getClassMiddlewareForPath($path)->all();

        return array_merge($classMiddleware, array_get($this->middleware, $path->method, []));
    }