bgultekin / laravel4-datatables-package

Server-side handler of DataTables Jquery Plugin for Laravel 4
267 stars 108 forks source link

Mongo Eloquent Issue #76

Open duffybelfield opened 10 years ago

duffybelfield commented 10 years ago

Hi there,

Currently I'm using https://github.com/jenssegers/Laravel-MongoDB to integrate MongoDB.

When I try:
$users = User::all();

I get: Call to undefined method Illuminate\Database\Eloquent\Collection::getQuery()

Any ideas?

MarkVaughn commented 10 years ago

I am not experienced enough with Mongo DB .

Please check lines 161 & 162

$this->query_type = $query instanceof \Illuminate\Database\Query\Builder ? 'fluent' : 'eloquent';
$this->columns = $this->query_type == 'eloquent' ? $this->query->getQuery()->columns : $this->query->columns;

This is probably where the issue stems. Is the query eloquent? If so, does it have the method getQuery? How can you get the query? How can you get the columns?

ktunkiewicz commented 10 years ago

Added to TO DO list for 1.4.1 release #122