src/Services/NestableService.php
public function hasChild($key = null, $value = null, Collect $data = null)
    {
        if (func_num_args() < 3) {
            $data = $this->data;
            $key = $this->parent;
            $value = current(func_get_args());
        }

        $child = false;

        $data->each(function ($item) use (&$child, $key, $value) {

            if (intval($item[$key]) == intval($value) && !$child) {
                $child = true;
            }

        });

        return $child;
    }
public function hasChild($key = null, $value = null, Collect $data = null)
    {
        if (func_num_args() < 3) {
            $data = $this->data;
            $key = $this->parent;
            $value = current(func_get_args());
        }

        $child = false;

        $data->each(function ($item) use (&$child, $key, $value) {

            if (intval($item[$key]) == intval($value) && !$child) {
                $child = true;
            }

        });

        return $child;
    }
public function hasChild ( $ key = null , $ value = null , Collect $ data = null ) { if ( func_num_args ( ) < 3 ) { $ data = $ this -> data ; $ key = $ this -> parent ; $ value = current ( func_get_args ( ) ) ; } $ child = false ; $ data -> each ( function ( $ item ) use ( & $ child , $ key , $ value ) { if ( intval ( $ item [ $ key ] ) == intval ( $ value ) && ! $ child ) { $ child = true ; } } ) ; return $ child ; }
Child menu checker.

@param string $key
@param mixed  $value
@param object $data  Illuminate\Support\Collection as Collect

@return bool
Child menu checker .