atayahmet / laravel-nestable

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

Laravel 5.7 htmlspecialchars() error? #62

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi! When I tried to get nested nav in controller: $navigation = Navigation::nested()->get(); And push it as prop via blade to vue:

<navigations :navigation="{{ $navigation }}"></navigations>

I got an error: htmlspecialchars() expects parameter 1 to be string, array given (View: /Users/Drake/Sites/test/resources/views/navigations/index.blade.php)

I have no idea what's happened with, because without package everything works fine, I mean, when I pushing data like: $navigation = Navigation::all()

Any idea? Thx

atayahmet commented 6 years ago

Hi @MMysiv

Use this: Navigation::renderAsJson()