Spatie\Menu\Menu::build PHP Метод

build() публичный статический Метод

Build a new menu from an array. The callback receives a menu instance as the accumulator, the array item as the second parameter, and the item's key as the third.
public static build ( array | Iterator $items, callable $callback, Menu $initial = null ) : static
$items array | Iterator
$callback callable
$initial Menu
Результат static
    public static function build($items, callable $callback, Menu $initial = null)
    {
        return ($initial ?: static::new())->fill($items, $callback);
    }