Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

afoysal's avatar

Use Larave route to vuejs component

I have an a tag in one of my VueJS component like below.

<a href="" class="btn btn-sm btn-white">
      <i class="tio-edit"></i>
 </a>

I would like to place route('admin.shop.time.edit',1) inside href with ID parameter.

How can I do it ?

0 likes
1 reply
tykus's avatar

You can use Laravel Ziggy to share your Laravel routes with your Vue application. It includes a Javascript route helper which works very like the Laravel one

1 like

Please or to participate in this conversation.