В Laravel для связи с ajax в файле blade.php, например:
{{ foreach($schhols as $school) }}
<td>{{ $school->user->name }}</td>
<td>{{ $school->user->address}}</td>
<td>{{ $school->user->country}}</td>
{{ endforeach }}
а вот в ajax с laravel как это сделать?
function load() {
$.get('/read', function (data){
$('#data').html("");
$.each(data, function (key, val) {
$('#data').append("<tr>"+
"<td>"+val.id+"</td>"+
"<td id='ename'>"+val.name+"</td>"+
"<td id='eaddress'>"+val.address+"</td>"+
"<td id='ecountry'>"+val.country+"</td>"+
"<td>"+
"<button class='btn btn-warning' id='edit' data-id="+val.id+">Edit</button>"+
"<button class='btn btn-danger' id='delete' data-id="+val.id+">Delete</button>"
+"</td>"+
+"</tr>")
});
});
}
Это случится?
"<td id='ename'>"+val.user.name+"</td>"+
"<td id='eaddress'>"+val.user.address+"</td>"+
"<td id='ecountry'>"+val.user.country+"</td>"+