public function resolveOrFail($middleware, &$key = null)
    {
        if ($this->isCollection($middleware)) {
            return $this->resolveManyOrFail($middleware, $key ?: Group::DEFAULT_ID);
        } else {
            return $this->resolveOneOrFail($middleware, $key);
        }
    }