Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

getRelationQuery incompatible #2262

Closed
MeerKatDev opened this issue May 26, 2021 · 6 comments · Fixed by #2263
Closed

getRelationQuery incompatible #2262

MeerKatDev opened this issue May 26, 2021 · 6 comments · Fixed by #2263

Comments

@MeerKatDev
Copy link

MeerKatDev commented May 26, 2021

  • 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
@shopapps
Copy link

shopapps commented May 26, 2021

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

@sepisoltani
Copy link

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

@Ian-Tala
Copy link

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

@divine
Copy link
Contributor

divine commented May 27, 2021

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!

@denaviagt
Copy link

Helo, why i got the same error?

@sv-hmelevsky
Copy link

sv-hmelevsky commented Jan 22, 2023

Same error when i try use relations!

"laravel/framework": "^8.75",
"jenssegers/mongodb": "3.8"

Seems to update "jenssegers/mongodb": "3.8" at 3.8.5 fix my problem!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants