Custom filters on BelongsToMany throws BadMethodCallException
Open
- 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
Assessment
This issue has not been assessed yet.