![]()
WARNING You're browsing the documentation for an upcoming version of Laravel DataTables. The documentation and features of this release are subject to change.
Array Response
The default response of the package is an array of objects. If you prefer to return an array response, use make(false)
.
use DataTables; Route::get('user-data', function() { $model = App\User::query(); return DataTables::eloquent($model) ->addColumn('intro', 'Hi {{$name}}!') ->make(false);});
Example Response
{ "draw": 1, "recordsTotal": 10, "recordsFiltered": 3, "data": [ ]}