I have the following simple controller:
class OrdersController extends \BaseController {
public function index()
{
$orders = Order::all();
return Datatables::of($orders)->make();
}
}
Trying to use the bllim DataTables package to output my tables. When I can DataTables above, I get this error:
Call to undefined method Illuminate\Database\Eloquent\Collection::getQuery()
The error is located in \Bllim\Datatables\Datatables.php
on the line:
$this->columns = $this->query_type == 'eloquent' ? $this->query->getQuery()->columns : $this->query->columns;
This method should be defined, unless I am mistaken. So what is missing here?