I want to pass ID to my route via ajax but cant do that:
function test(id){
$('#items').DataTable({
ajax: {
url: '{!! route('routename', ['menu_id' => id]) !!}',
type: 'POST'
},
It says Use of undefined constant id. How can i use javascript variables to pass through route?