jeudi 20 août 2015

Invalid json response error while implementing datatables in laravel 5.1

I have just been following this tutorial on http://ift.tt/1gZNE7v . I get a blank table with an error of invalid json response. When I validate my url on http://jsonlint.com i get this error

Expecting '{', '['

When i do a dd(Datatables::of(Remit::select('*'))->make(true)) I do get results from my remit table on the browser so the query cant be the problem.

Could anyone have an idea where to change the json format sent from the server? I tried playing around with this block of code but with no luck

$(function() {
$('#remit-table').DataTable(
{
    processing: true,
    serverSide: true,
    ajax: '{!! route('datatables.data') !!}',
    columns: [
        { data: 'id', name: 'id' },
        { data: 'name', name: 'name' },
        { data: 'reference', name: 'reference' },
        { data: 'mobile', name: 'mobile' },
        { data: 'billing', name: 'billing' }
    ]
});
});



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1hPsqtN
via IFTTT

Aucun commentaire:

Enregistrer un commentaire