esbenp / esbenp/bruno

Custom filters on BelongsToMany throws BadMethodCallException

Open
#45 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
163
Forks
70
PR merge metrics
No merged PRs in 30d

Description

` "message": "Call to undefined method Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany::getQualifiedRelatedKeyName()",
"exception": "BadMethodCallException",
"file": "/var/www/bneapilocal/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php",
"line": 50,
`

In EloquentBuilderTrait.php
In method joinRelatedModelIfExists
At line 299

Custom filters on BelongsToMany throws exception on the method call at line 299:
`$relation->getQualifiedRelatedKeyName()`
When I change it to:
`$relation->getQualifiedRelatedPivotKeyName()`

This works fine.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.