laravel4-datatables-package icon indicating copy to clipboard operation
laravel4-datatables-package copied to clipboard

Mongo Eloquent Issue

Open duffybelfield opened this issue 11 years ago • 2 comments

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?

duffybelfield avatar Feb 12 '14 05:02 duffybelfield

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?

MarkVaughn avatar Feb 12 '14 12:02 MarkVaughn

Added to TO DO list for 1.4.1 release #122

ktunkiewicz avatar Jul 25 '14 07:07 ktunkiewicz