mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)
https://www.mongodb.com/compatibility/mongodb-laravel-integration
MIT License
7k stars 1.43k forks source link

bad sort specification in ../vendor/mongodb/mongodb/src/Operation/Find.php #1739

Open ludo1960 opened 5 years ago

ludo1960 commented 5 years ago

I am struggling to resolve an issue, trying to install laravel-admin, all seem well with the install, but when I try to browse the site I get the following error /var/www/slimmongo.local.com/vendor/mongodb/mongodb/src/Operation/Find.php /**

Arguments "bad sort specification (View: /var/www/slimmongo.local.com/vendor/encore/laravel-admin/resources/views/partials/sidebar.blade.php) (View: /var/www/slimmongo.local.com/vendor/encore/laravel-admin/resources/views/partials/sidebar.blade.php) (View: /var/www/slimmongo.local.com/vendor/encore/laravel-admin/resources/views/partials/sidebar.blade.php) `

The contents of the partial are:

`

`

Can anybody suggest where to start digging?

ludo1960 commented 5 years ago

Mongo does not like @each('admin::partials.menu', Admin::menu(), 'item') Any solutions?

vntrungld commented 5 years ago

This is laravel-admin bug, not laravel-mongodb bug

My solution: Replace all content in function allNodes of Menu model by return static::with('roles')->orderBy('order')->get()->toArray();

ludo1960 commented 5 years ago

Thank you Lam, got it working! 血淋淋的奇妙

There is an extra item in the menu "index" at the top, Admin will not let me delete it and when I try to edit the page I get " ModelNotFoundException In Builder.php line 369 : No query results for model [Encore\Admin\Auth\Database\Menu] 1" Is it the same for you? Do I just ignore it?

谢谢

ludo1960 commented 5 years ago

Eeek!! trying to insert any data i.e. permissions, roles. users. Results in

"FatalThrowableError In ManagesTransactions.php line 109 :Call to a member function beginTransaction() on null"

GromNaN commented 10 months ago

Feature request tracked in Jira PHPORM-120