You have an error in your route method. The second parameter has to be an array.
route('inscripcioneswebs.edit', ['INS_WEB_ID' => $inscripcionesweb->INS_WEB_ID])
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to do a simple href in my vue template, but for some reason my Laravel Mix can't compilate the code.
In a Laravel .blade I'm using <a href="{{ route('inscripcionesweb.edit', $inscripcionesweb->INS_WEB_ID) }}"> as example that what I want.
In this Vue the :href ="{{ route('inscripcioneswebs.edit', $inscripcionesweb->INS_WEB_ID) }} is the main error, the rest of code works perfectly.
template.vue<template>
<table id="myTable">
<thead>
<tr>
<th>ID</th>
<th>NAME</th>
</tr>
</thead>
<tbody>
<tr v-for="inscripcionesweb in inscripcioneswebs" >
<td>
<a :href ="{{ route('inscripcioneswebs.edit', $inscripcionesweb->INS_WEB_ID) }}">
{{ inscripcionesweb.INS_WEB_ID }}
</a>
</td>
<td> {{ inscripcionesweb.INS_WEB_CUR_NAME }} </td>
</tr>
</tbody>
</table>
</template>
<script>
import datatables from 'datatables'
export default {
mounted() {
this.getInscripcionesWebs()
},
data() {
return {
inscripcioneswebs: [],
}
},
methods: {
myTable() {
$(function () {
$('#myTable').DataTable();
});
},
getInscripcionesWebs() {
var urlInscripcionesWebs = "inscripcioneswebs/show";
axios.get(urlInscripcionesWebs).then(response => {
this.inscripcioneswebs = response.data
this.myTable()
})
},
}
}
</script>
I tried too with:
<a :href="route('inscripcioneswebs.edit', $inscripcionesweb->INS_WEB_ID)">
{{ inscripcionesweb.INS_WEB_ID }}
</a>
<a :href="inscripcioneswebs/{{ inscripcionesweb.INS_WEB_ID }}/edit">
{{ inscripcionesweb.INS_WEB_ID }}
</a>
<a :href="inscripcioneswebs/inscripcionesweb.INS_WEB_ID/edit">
{{ inscripcionesweb.INS_WEB_ID }}
</a>
But nothing...
I must use some part of <script> section to work?
@El conde Lucanor Oh sorry you are using VueJS. You can't use the route() helper in VueJS. You have to define your routes inside VueJS with the VueJS router.
You can also use Laravel and Vuejs with InertiaJS, and in this way you can use the route()helper.
Please or to participate in this conversation.