我有以下簡單的控制器:Bllim數據表拋出未定義getQuery()異常
class OrdersController extends \BaseController {
public function index()
{
$orders = Order::all();
return Datatables::of($orders)->make();
}
}
試圖使用bllim數據表包輸出到我的表。當我能數據表上面,我得到這個錯誤:
Call to undefined method Illuminate\Database\Eloquent\Collection::getQuery()
錯誤位於\Bllim\Datatables\Datatables.php
上線:
$this->columns = $this->query_type == 'eloquent' ? $this->query->getQuery()->columns : $this->query->columns;
這個方法應該被定義,除非是我弄錯了。那麼這裏錯過了什麼?
完全錯過了。 **臉掌**感謝! – eComEvo
不客氣:-) –
在完整的一面註釋...酷編碼權力的動物。 :) – eComEvo