Laravel-mongodb: Jenssegers\Mongodb\Eloquent\HybridRelations::belongsToMany should be compatible with Illuminate\Database\Eloquent\Model::belongsToMany

Created on 20 Sep 2017  路  3Comments  路  Source: jenssegers/laravel-mongodb

I get this error when trying to add your package using composer:

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
)   

I have Laravel 5.5.7

question

Most helpful comment

for 5.5 use alpha release:
$ composer require jenssegers/mongodb:^3.3.0-alpha

All 3 comments

Latest stable version of this package does not support L5.5 for now. An alpha release (v3.3.0) is available for L5.5 support. You can try that.

https://github.com/jenssegers/laravel-mongodb/tree/v3.3.0-alpha

for 5.5 use alpha release:
$ composer require jenssegers/mongodb:^3.3.0-alpha

@ajaybhargav Thanks, it fixed my issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bastiendonjon picture bastiendonjon  路  3Comments

cherbert picture cherbert  路  3Comments

pirmax picture pirmax  路  3Comments

Idnan picture Idnan  路  3Comments

BlakeGardner picture BlakeGardner  路  3Comments