DataTable error count(): Parameter must be an array or an object that implements Countable
DataTable error count(): Parameter must be an array or an object that implements Countable

I am using Laravel for this, all other things and functions work properly. Datatable call in other functions work properly but in this function it throws
count(): Parameter must be an array or an object that implements Countable
Code is as following
$clicks=History::orderBy('id','DESC');
return DataTables::of($clicks)->make(true);
Does anyone know why is it happening?
This discussion has been closed.
Answers
That error isn't from DataTables, I'm afraid - I did a search for "Countable" on the code and there's no match - so it must be something else triggering it in your stack.
Colin
If i remove Datatable::of($clicks)->make(true)
then everything works properly. So this is the error in the datatable call.
It'll be the Laravel integration, so at least a layer above DataTables. It would be worth looking on SO, there are a few threads with that error, for example here.
Colin