Laravel Yajra datatables ajax serverside slow down page load
I'm using Yajra datatables with serverside true, but page load very slow (afraid because of distinct count). I tried solution here by removing ->get() and it load faster but this causing another problem, where the input searching (smart: true) return error, not functioning. Anyone can help?
Here is my开发者_运维问答 code:
$links = Link::with('owner')
->withCount(['clicks as uniqueClicks' => function($q) {
$q->select(DB::raw('count(distinct(ip_address))'));
}])
->where('account_id', $account_id)
->orderBy('created_at','desc')
->get();
return Datatables::of($links)->make();
精彩评论