use laravel route in js file code example
Example: call laravel route js
function confirmDelete(id){
let url = "{{ route('getDeleteRequest', ':id') }}";
url = url.replace(':id', id);
document.location.href=url;
}
function confirmDelete(id){
let url = "{{ route('getDeleteRequest', ':id') }}";
url = url.replace(':id', id);
document.location.href=url;
}