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.
- Installed Mongo db and its php extension.
- Installed this Laravel package.
- Added the service provider
- Configured DB
- Created the model
- And finally
$user = DB::connection('mongodb')->collection('users')->get();