lavary/laravel-menu

Attribute of menu and menu item are not working properly.

Opened this issue · 0 comments

Hi there, I met 2 issues when using your package. I hope you can help

1 - When I use the below method:

{!! $menu->asUl( ['class' => 'first-level-ul'], ['class' => 'second-level-ul'], ['class' => 'second-level-li'] ) !!}

the 'second-level-li' will appear twice in li tag, for example:
<li class="second-level-li second-level-li">

2 - When I add atribute attr() to each link when create menu, for example:
$menu->add(trans($link->name), ['url' => $link->link])
->prepend($link->prepend)
->append($link->append)
->nickname($link->nickname)
->data('order', $link->dis_order)
->link->attr(['class' => $link->class]);
active status of links which have no sub menu items cannot be active anymore because there is no 'active' css class in tag.