src/Resolver.php
public function resolveOrFail($middleware, &$key = null)
    {
        if ($this->isCollection($middleware)) {
            return $this->resolveManyOrFail($middleware, $key ?: Group::DEFAULT_ID);
        } else {
            return $this->resolveOneOrFail($middleware, $key);
        }
    }
public function resolveOrFail($middleware, &$key = null)
    {
        if ($this->isCollection($middleware)) {
            return $this->resolveManyOrFail($middleware, $key ?: Group::DEFAULT_ID);
        } else {
            return $this->resolveOneOrFail($middleware, $key);
        }
    }
Resolve the given middleware or throw an exception if the argument isn't valid.

@throws \InvalidArgumentException

@param mixed $middleware
@param mixed $key
@return bool|\Closure|\MichaelRShelton\MiddleMan\Interfaces\MiddlewareInterface|\MichaelRShelton\MiddleMan\Interfaces\MiddlewareCollection