我在Laravel 5.5开发一个Mongo DB应用程序。但是在包中得到以下错误https://github.com/jenssegers/laravel-mongodb.
Jenssegers\Mongodb\Eloquent\HybridRelations::BelongToMany($related,$collection=NULL,$foreignKey=NULL,$otherKey=NULL,$relations=NULL)的声明应与Lightlight\Database\Eloquent\Model::BelongToMany兼容($related,$table=NULL,$foreignPivotKey=NULL,$relatedprovotkey=NULL,$parentKey=NULL,$relatedKey=NULL,$relation=NULL)
以下是我做的步骤。
$user=DB::connection('mongodb')-
据我所知,Laravel 5.5已更改了belongTomany
方法的签名,因此您应该等到该软件包与Laravel 5.5兼容后,我发现有关此问题的问题已在此处创建:https://github.com/jenssegers/laravel-mongodb/issues/1279
今天发布了一个版本,支持laravel 5.5,在存储库中运行更新。
在composer中使用版本3.3“jenssegers/mongodb”:“3.3.*”
这个问题现在已经解决了。请检查这个文件。使用此修复程序覆盖本地文件解决了问题。