laravel-eloquent-join
laravel-eloquent-join copied to clipboard
OrderByJoin for BelongsTo relationships breaks in laravel 5.5
https://github.com/fico7489/laravel-eloquent-join/pull/104
This PR changed how the correct method call is determined by checking if the method name is_callable() or not. However, in our testing with a BelongsTo relationship in Laravel 5.5 is_callable() is returning true no matter what method name you pass and so picks the wrong method to call resulting in an error.
We have rolled back to 4.1.1 in the meantime where the old version check logic is in place.
I encountered same problem with Eloquent 5.7.17 when updated my fork.
Update: I changed is_callable([$relatedRelation, 'getQualifiedForeignKeyName'])
to method_exists($relatedRelation, 'getQualifiedForeignKeyName')
(same with 'getOwnerKeyName') and it seems to start working