Use your Laravel named Routes inside JavaScript
"Ziggy provides a JavaScript
route()
helper function that works like Laravel's, making it easy to use your Laravel named routes in JavaScript.It creates a Blade directive which you can include in your views. This will export a JavaScript object of your application's named routes, keyed by their names (aliases), as well as a global route() helper function which you can use to access your routes in your JavaScript."