<?php

namespace App\Menu;

use Sebastienheyd\Boilerplate\Menu\Builder;

class Settings
{
    public function make(Builder $menu)
    {
        $menu->add('Paramètres', ['permission' => 'backend_access', 'icon' => 'cogs'])
            ->id('settings')
            ->activeIfRoute('settings')
            ->order(7);

        $menu->addTo('settings', __('shop.delivery_types.title'), [
            'route' => 'Admin.Shop.DeliveryTypes.index',
            'permission' => 'backend_access',
        ])->activeIfRoute(['Admin.Shop.DeliveryTypes.*'])->order(1);

        $menu->addTo('settings', __('shop.delivery_type_calculations.title'), [
            'route' => 'Admin.Shop.DeliveryTypeCalculations.index',
            'permission' => 'backend_access',
        ])->activeIfRoute(['Admin.Shop.DeliveryTypeCalculations.*'])->order(2);

        $menu->addTo('settings', __('shop.delivery_packages.title'), [
            'route' => 'Admin.Shop.DeliveryPackages.index',
            'permission' => 'backend_access',
        ])->activeIfRoute(['Admin.Shop.DeliveryPackages.*'])->order(3);
    }
}
