I'm trying to submit a form in Vue, my route is
http://cricketstats.test/en/dashboard/players/z2d4ca09a7/india/941/runs
Here 941
is the player ID. I want this id to be passed to the Laravel controller along with the rest of the form data as well.
Is there a way to get this id from the url in vue and pass it to the laravel controller?
The simple code below will extract what you need.
After that, all you need to do is make an ajax/axios request to the controller.
Here are ideas on how to send data to a controller using ajax: