src/Support/Concerns/Descendible.php
protected function descendants(array $array, ?string $key = null)
    {
        if (\is_null($key)) {
            return $array;
        }

        $keys = \explode('.', $key);
        $first = \array_shift($keys);

        if (! isset($array[$first])) {
            return null;
        }

        return $this->resolveLastDecendant($array[$first], $keys);
    }
protected function descendants(array $array, ?string $key = null)
    {
        if (\is_null($key)) {
            return $array;
        }

        $keys = \explode('.', $key);
        $first = \array_shift($keys);

        if (! isset($array[$first])) {
            return null;
        }

        return $this->resolveLastDecendant($array[$first], $keys);
    }
protected function descendants ( array $ array , ? string $ key = null ) { if ( \ is_null ( $ key ) ) { return $ array ; } $ keys = \ explode ( '.' , $ key ) ; $ first = \ array_shift ( $ keys ) ; if ( ! isset ( $ array [ $ first ] ) ) { return null ; } return $ this -> resolveLastDecendant ( $ array [ $ first ] , $ keys ) ; }
Get last descendant node from items recursively.

@param  array  $array
@param  string|null  $key

@return \Illuminate\Support\Fluent|array|null
Get last descendant node from items recursively .