7 months ago

DataTables warning: table id=student_table - Ajax error. with Yajra Laravel

Posted 7 months ago by LYiub

I just used Yajra (datatable "yajra/laravel-datatables": "^1.0" ) on laravel (5.4.16), PHP version 7.1 .

I got this error while loading :

DataTables warning: table id=student_table - Ajax error. For more information about this error, please see

and on inspect:

jquery.js:8526 GET 500 (Internal Server Error)

this is my app.php:



    'DataTables' => Yajra\DataTables\Facades\DataTables::class

and I tried to make the ' Y ' small letter but still have the same error.

My controller :

use DataTables;

class LeadsController extends Controller
   public function gettesting()

        return view('testing');

    public function testing()
        $students = Meeting::select('name', 'details');

        return DataTables::of($students)->make(true);


my route is as follows:

Route::get('testing', '[email protected]');
Route::get('leads/testing', '[email protected]')->name('leads.testing');

My view 'testing' :

<!DOCTYPE html>

    <link href="" rel="stylesheet">
    <link  href="" rel="stylesheet">
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>


<div class="container">
    <div align="right">
        <button type="button" name="add" id="add_data" class="btn btn-success btn-sm">Add</button>
    <table id="student_table" class="table table-bordered" style="width:100%">


    $(document).ready(function () {
            "processing": true,
            "serverSide": true,
            "ajax": "{{ url('leads/testing') }}",
            "method": "GET",
            "columns": [
                {"data": "name"},
                {"data": "details"}




Please help me to solve it

Please sign in or create an account to participate in this conversation.