2

I am developing a Mongo DB app in Laravel 5.5. But getting following error in the package https://github.com/jenssegers/laravel-mongodb.

Declaration of Jenssegers\Mongodb\Eloquent\HybridRelations::belongsToMany($related, $collection = NULL, $foreignKey = NULL, $otherKey = NULL, $relation = NULL) should be compatible with Illuminate\Database\Eloquent\Model::belongsToMany($related, $table = NULL, $foreignPivotKey = NULL, $relatedPivotKey = NULL, $parentKey = NULL, $relatedKey = NULL, $relation = NULL)

Following are the steps I did.

  1. Installed Mongo db and its php extension.
  2. Installed this Laravel package.
  3. Added the service provider
  4. Configured DB
  5. Created the model
  6. And finally
    $user = DB::connection('mongodb')->collection('users')->get();
4

3 回答 3

2

据我所知,Laravel 5.5 已经改变了belongsToMany方法的签名,所以你应该等到这个包与 Laravel 5.5 兼容我看到关于这个的问题已经在这里创建了:https ://github.com/jenssegers/laravel-mongodb/问题/1279

于 2017-09-03T09:15:57.597 回答
2

今天发布了一个支持 laravel 5.5 的版本,在存储库中运行更新。

在作曲家使用 3.3 版"jenssegers/mongodb": "3.3.*"

于 2017-09-18T21:23:51.467 回答
-1

现在已修复。请检查此文件。使用此修复程序覆盖本地文件解决了该问题。

于 2017-09-07T13:14:19.383 回答