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

fill() публичный Метод

Fill a 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 fill ( array | Iterator $items, callable $callback ) : static
$items array | Iterator
$callback callable
Результат static
    public function fill($items, callable $callback)
    {
        $menu = $this;
        foreach ($items as $key => $item) {
            $menu = $callback($menu, $item, $key);
        }
        return $menu;
    }