It is very simple to use this bundle. Just create your own fluent query object or eloquent object without getting results (that means don't use get(), all() or similar methods) and give it to Datatables. You are free to use all Eloquent ORM and Fluent Query Builder features.
By calling the all()
method you are returning an Illuminate\Database\Eloquent\Collection
object which in this case doesn't contain the getQuery()
method, you need to pass a Illuminate\Database\Eloquent\Builder
or Illuminate\Database\Query\Builder
instead.
Try this:
return Datatables::of(Order::select(array('id', 'othercolumns')))->make();
Or this:
$query = DB::table('orders')->select(array('id','othercolumns'));
return Datatables::of($query)->make();
Select the columns you want to show in the data table in the array.