protected function middlewareAppliesToMethod($method, array $middleware)
    {
        if (!empty($middleware['only']) && !in_array($method, $middleware['only'])) {
            return false;
        } elseif (!empty($middleware['except']) && in_array($method, $middleware['except'])) {
            return false;
        }

        return true;
    }