Pass array to Laravel view and use that array as VueJS prop
You should use {!! json_encode($ticket) !!}}
This works - it was hard to find this answer on the web so I hope it helps! You have to bind it.
<edit-ticket-template
v-bind:SingleTicket="{{ json_encode($ticket) }}"
v-bind: screenshots ="{{ json_encode($files) }}"
>
</edit-ticket-template>
Yeah I don't think you need to json_encode the single ticket but you get the point.
I think Blade calls htmlentities()
automatically when you write {{ $ticket }}
. Since $ticket
is not a string, it is erroring. Try {{ json_encode($ticket) }}