src/Services/HCMenuService.php
private function existInArray($items, $routeName): bool
    {
        foreach ($items as $item) {

            if ($item['route'] == $routeName) {
                return true;
            }

            if (array_key_exists('children', $item)) {
                $found = $this->existInArray($item['children'], $routeName);

                if ($found) {
                    return true;
                }
            }
        }

        return false;
    }
private function existInArray($items, $routeName): bool
    {
        foreach ($items as $item) {

            if ($item['route'] == $routeName) {
                return true;
            }

            if (array_key_exists('children', $item)) {
                $found = $this->existInArray($item['children'], $routeName);

                if ($found) {
                    return true;
                }
            }
        }

        return false;
    }
private function existInArray ( $ items , $ routeName ) : bool { foreach ( $ items as $ item ) { if ( $ item [ 'route' ] == $ routeName ) { return true ; } if ( array_key_exists ( 'children' , $ item ) ) { $ found = $ this -> existInArray ( $ item [ 'children' ] , $ routeName ) ; if ( $ found ) { return true ; } } } return false ; }
Check if exists in array

@param $items
@param $routeName
@return bool
Check if exists in array