Closed palo closed 6 years ago
I'm trying to render multiple dropdowns from level 0 categories, like so:
$categories = Category::nested()->get();
@foreach ( $categories as $category ) {!! nestable($category)->renderAsDropdown() !!} @endforeach
But getting this error: "Illegal string offset 'parent_id'"..
If i pass it like this:
@foreach ( $categories as $category ) {!! nestable($category['child'])->renderAsDropdown() !!} @endforeach
It renders empty dropdowns
Can you please explain how to achieve this?
Hi @palo
You can do it like this:
@foreach ( $categories as $category ) {!! nestable([$category])->renderAsDropdown() !!} @endforeach
Thank you
I'm trying to render multiple dropdowns from level 0 categories, like so:
$categories = Category::nested()->get();
But getting this error: "Illegal string offset 'parent_id'"..
If i pass it like this:
It renders empty dropdowns
Can you please explain how to achieve this?