我正在try 通过Laravel中的AJAX请求将记录ID发送到资源控制器进行编辑.我的代码如下所示.
function editdetails(id) {
$.ajax({
type:'GET',
url:"{{ route('users.edit', id ) }}",
success:function(data){
console.log(data);
}
});
}
但我收到了如下错误.
Use of undefined constant id - assumed 'id' (this will throw an Error in a future version of PHP)