Laravel Passing route to js
问题 I have a separate js file into laravel public folder, I have decleard my route into web.php, I can use them in blade file but getting error while try to use them in that js file. $.ajax({ //url:"http://127.0.0.1:8000/cats/fetch", url:"{{route('cats.fetch')}}", method:"POST", data:{select:select, value:value, _token:_token, dependent:dependent}, success:function(result) { $('#'+dependent).html(result); } }) but when I use hard coded url then its work for instance url:"cats/fetch". How can I