<?php

namespace App\Menu;

use Sebastienheyd\Boilerplate\Menu\Builder;

class Botanic
{
    public function make(Builder $menu)
    {
        $menu->add('Botanique', ['permission' => 'backend_access', 'icon' => 'leaf'])
            ->id('botanic')
            ->activeIfRoute('botanic')
            ->order(4);

        $menu->addTo('botanic', 'Familles', ['route' => 'Admin.Botanic.Families.index', 'permission' => 'backend_access'])
            ->activeIfRoute(['Admin.Botanic.Families.*'])->order(1);
        $menu->addTo('botanic', 'Genres', ['route' => 'Admin.Botanic.Genres.index', 'permission' => 'backend_access'])
            ->activeIfRoute(['Admin.Botanic.Genres.*'])->order(2);
        $menu->addTo('botanic', 'Espèces', ['route' => 'Admin.Botanic.Species.index', 'permission' => 'backend_access'])
            ->activeIfRoute(['Admin.Botanic.Species.*'])->order(3);
        $menu->addTo('botanic', 'Variétés', ['route' => 'Admin.Botanic.Varieties.index', 'permission' => 'backend_access'])
            ->activeIfRoute(['Admin.Botanic.Varieties.*'])->order(4);
    }
}
