public function setActive($urlOrCallable, string $root = '/')
    {
        if (is_string($urlOrCallable)) {
            return $this->setActiveFromUrl($urlOrCallable, $root);
        }

        if (is_callable($urlOrCallable)) {
            return $this->setActiveFromCallable($urlOrCallable);
        }

        throw new \InvalidArgumentException('`setActive` requires a pattern or a callable');
    }
public function setActive($urlOrCallable, string $root = '/')
    {
        if (is_string($urlOrCallable)) {
            return $this->setActiveFromUrl($urlOrCallable, $root);
        }

        if (is_callable($urlOrCallable)) {
            return $this->setActiveFromCallable($urlOrCallable);
        }

        throw new \InvalidArgumentException('`setActive` requires a pattern or a callable');
    }
public function setActive ( $ urlOrCallable , string $ root = '/' ) { if ( is_string ( $ urlOrCallable ) ) { return $ this -> setActiveFromUrl ( $ urlOrCallable , $ root ) ; } if ( is_callable ( $ urlOrCallable ) ) { return $ this -> setActiveFromCallable ( $ urlOrCallable ) ; } throw new \ InvalidArgumentException ( '`setActive` requires a pattern or a callable' ) ; }
Set multiple items in the menu as active based on a callable that filters
through items. If you typehint the item parameter in the callable, it will
only be applied to items of that type.

@param callable|string $urlOrCallable
@param string $root

@return $this
Set multiple items in the menu as active based on a callable that filters through items . If you typehint the item parameter in the callable it will only be applied to items of that type .