protected function clearMiddleware(string $group = null)
    {
        if ($group === null) {
            $this->middleware = new Group;
        } else {
            unset($this->middleware[$group]);
        }
        return $this;
    }
protected function clearMiddleware(string $group = null)
    {
        if ($group === null) {
            $this->middleware = new Group;
        } else {
            unset($this->middleware[$group]);
        }
        return $this;
    }
protected function clearMiddleware ( string $ group = null ) { if ( $ group === null ) { $ this -> middleware = new Group ; } else { unset ( $ this -> middleware [ $ group ] ) ; } return $ this ; }
Clears the given middleware group or all if none given.

@param string|null $group
@return $this
Clears the given middleware group or all if none given .