laravel-eloquent-join icon indicating copy to clipboard operation
laravel-eloquent-join copied to clipboard

OrderByJoin for BelongsTo relationships breaks in laravel 5.5

Open ADRDev opened this issue 4 years ago • 1 comments

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.

ADRDev avatar Nov 11 '20 18:11 ADRDev

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

NesCafe62 avatar Nov 20 '20 14:11 NesCafe62