0๐
Iโm pretty useless when it comes to Laravel but it sounds like you want to map the $exam
array to an array of routes (returned by that route
function).
Try this
<user-exam
:routes="{{ json_encode( array_map(function($ex) {
return route('user.exam-start', ['exam' => $ex]);
}, $exam) ) }}"
></user-exam>
- [Vuejs]-Debug VUE app for REST API call protected using Auth0 in VS Code
- [Vuejs]-Shared session between laravel and vue apps
0๐
I found a solution to my issue, I ended up looping in the blade file like this
@foreach($exam as $ex)
<user-exam
:routes="{{ json_encode( route('user.exam-start', ['exam' => $ex]))}}"
></user-exam>
@endforeach
THis ends up creating multiple instances of the vue component but it is working as I wanted it to.
Sin the vue dev tools you have something like:
<Root>
<userExam>
<userExam>
</Root>
Source:stackexchange.com