Vue js object property called within a blade call possible?

Posted 2 years ago by douglas_quaid

Hi I have the following inline-template for a list of courses

<courses inline-template>
        <div>
            <ul v-for="course in courses.data">
                <li><a href="{{ route('course.show', ['id' => @{{course.id}}]) }}"><b>@{{ course.name }}</b></a></li>
                <p>@{{ course.description }}</p>
                <ul v-for="lesson in course.lessons">
                    <li><a href="#"><b>@{{ lesson.name }}</b></a></li>
                    <p>@{{ lesson.description }}</p>
                </ul>
            </ul>
        </div>
    </courses>

I want to reference the route to a course nicknamed 'course.show' (/courses/{course}) and I want to pass in to the route the id that the vue course object has. However, Laravel is saying

Parse error: syntax error, unexpected '{'

How do I fix this call? Is this even possible to call vue js property inside of a laravel blade route function?

Thanks.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.