src/Models/MenuItem.php
public function activateOnRoute(string $route)
    {
        $this->activeWhen = function () use ($route) {
            return str_contains(Route::currentRouteName(), $route);
        };

        return $this;
    }
public function activateOnRoute(string $route)
    {
        $this->activeWhen = function () use ($route) {
            return str_contains(Route::currentRouteName(), $route);
        };

        return $this;
    }
public function activateOnRoute ( string $ route ) { $ this -> activeWhen = function ( ) use ( $ route ) { return str_contains ( Route :: currentRouteName ( ) , $ route ) ; } ; return $ this ; }
Set active callback on the given route.

@param string $route

@return $this
Set active callback on the given route .