src/JumpGate/Menu/Container.php
private function makeActive($item, $parent = null)
    {
        $item->links->each(function ($link) use ($item, $parent) {
            if ($link->slug == $this->active) {
                $this->makeParentActive($parent);
                $this->makeParentActive($item);

                $link->setActive(true);
            }

            if (isset($link->links)) {
                $this->makeActive($link, $item);
            }
        });
    }
private function makeActive($item, $parent = null)
    {
        $item->links->each(function ($link) use ($item, $parent) {
            if ($link->slug == $this->active) {
                $this->makeParentActive($parent);
                $this->makeParentActive($item);

                $link->setActive(true);
            }

            if (isset($link->links)) {
                $this->makeActive($link, $item);
            }
        });
    }
private function makeActive ( $ item , $ parent = null ) { $ item -> links -> each ( function ( $ link ) use ( $ item , $ parent ) { if ( $ link -> slug == $ this -> active ) { $ this -> makeParentActive ( $ parent ) ; $ this -> makeParentActive ( $ item ) ; $ link -> setActive ( true ) ; } if ( isset ( $ link -> links ) ) { $ this -> makeActive ( $ link , $ item ) ; } } ) ; }
Loop through the links and check for active.
Sets the item and it's parents as active when told to.
Loop through the links and check for active . Sets the item and it s parents as active when told to .