atayahmet / laravel-nestable

Laravel 5 nested category/menu generator
MIT License
214 stars 52 forks source link

ulAttr not working ? #29

Closed shankhadevpadam closed 7 years ago

shankhadevpadam commented 7 years ago

I have following code but ulAttr not working

$menus = \App\MenuItem::where('menu_id', 1)->get()->toArray();
$menus = nestable($menus)->ulAttr(function($ul, $parent_id) {
            if($parent_id >= 0) {
                $ul->ulAttr('class', 'dropdown-menu');
            }
        })->active(function($li, $href, $label) {
                $li->addAttr('class', 'active');
        })->renderAsHtml();
        dd($menus);
atayahmet commented 7 years ago

Hi @shankhadevpadam

fixed. Check again.