Laravel-mongodb: getRelationQuery incompatible

Created on 26 May 2021  路  4Comments  路  Source: jenssegers/laravel-mongodb

  • Laravel-mongodb Version: 3.8.3
  • PHP Version: 7.4.19
  • Database Driver & Version:

Description:

<warning>PHP Warning:  
Declaration of Jenssegers\Mongodb\Relations\HasMany::getRelationQuery(Illuminate\Database\Eloquent\Builder $query, 
Illuminate\Database\Eloquent\Builder $parent, $columns = Array) should be compatible with 
Illuminate\Database\Eloquent\Relations\Relation::getRelationQuery() in C:\projects\lookinglass-
backend\vendor\jenssegers\mongodb\src\Jenssegers\Mongodb\Relations\HasMany.php on line 68</warning>

Steps to reproduce

  1. just declare a relation

Most helpful comment

For anybody dealing with this issue in Lumen (or also Laravel), you can alternatively force the version of illuminate/database for it to work, until this library is updated.

You'd set it like so:

composer require illuminate/database:8.42.1

All 4 comments

Had the same issue, it is due to latest laravel/framework.

had to rollback to 8.42.1 to get it to work:

composer require laravel/framework:8.42.1

having same problem
any solution other than downgrading to Laravel version 8.42.1 ??

For anybody dealing with this issue in Lumen (or also Laravel), you can alternatively force the version of illuminate/database for it to work, until this library is updated.

You'd set it like so:

composer require illuminate/database:8.42.1

Hello,

We're aware of this problem and currently looking for a solution.

This looks like a breaking change and probably requiring the release of a new version of this library.

Still in the talks with @Smolevich about it.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings