My controller:
function index()
{
return view('student.ajaxdata');
}
function getdata()
{
$student = Student::select('first_name', 'last_name', 'Age', 'Address', 'Grade_Level');
return Datatables::of($student)->make(true);
}
jQuery code:
$(document).ready(function() {
$('$students_table').Datatables({
"processing" : true;
"serverside" : true;
"ajax" : "{{route('ajaxdata.getdata')}}"
"column":[
{"data" : "first_name"},
{"data" : "last_name"},
{"data" : "Age"},
{"data" : "Address"},
{"data" : "Grade_Level"}
]
});
})
It supposed to fetch data and put in the table but in my case there's no error or anything but when i go to the view page there's no data was fetch.
:colon to indicate the material is following. I have seen people put the label at the end (in a sort of "see above" way) but it is rarely used, since people usually scan the page from top to bottom. (2) when asking questions, try to refrain from chatty material and pleading. Don't add crying eyes emoticons to show how sad you are, as some readers don't like begging and pleading - they may instead downvote and move on. This discussion may be useful.