I'm assuming $classification->todos returns related records. If so, it will be a collection of Eloquent objects, and Javascipt has no idea what those are or how to handle them. You need to pass a JS array to your function instead.
You could also look at something like: https://github.com/laracasts/PHP-Vars-To-Js-Transformer http://netsells.co.uk/blog/post/passing-data-to-your-javascript-in-laravel
Thanks, for answer. I got that object from a json object:
"classification" : {
"label" : "ASK FOR SOMETHING",
"todos" : [
"The first todo",
"The second todo"
]
}
So, i can render the Label and the Todos in the view, but, i need to send the todos to an argument in a javascript function
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community