jarektkaczyk / eloquence-base

base for the Eloquence extensions + Searchable
https://softonsofa.com
MIT License
77 stars 69 forks source link

Bug in calling unexisting function #12

Closed bert-w closed 4 years ago

bert-w commented 5 years ago

https://github.com/jarektkaczyk/eloquence-base/blob/master/src/Relations/Joiner.php#L197

This function getQualifiedForeignKey doesnt exist anymore on BelongsTo, see:

https://github.com/laravel/framework/blob/5.8/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php

It is now named getQualifiedForeignKeyName. I tried to trace down the date+version at which it was changed, but for some reason I am unable to find it in the commits. If anyone want to take a look that would be appreciated:

https://github.com/laravel/framework/commits/5.8/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php

As for a quickfix: anyone know how to easily override this class function so that I can make it work on Laravel 5.7/5.8?

OzanKurt commented 5 years ago

Just change the getQualifiedForeignKey to getQualifiedForeignKeyName and upload via FTP.

bert-w commented 5 years ago

obviously thats not gonna do much if you update composer...

I now simply copied the file and changed the line, and added it to composer.json like so:

"files": [
            "app/FixJoiner.php"
        ]
OzanKurt commented 5 years ago

Composer update will not affect any files unless the package has a newer version.

In case it does update, that bug would be fixed anyway, so you're all good. ;)

eddiebeltran33 commented 5 years ago

This also breaks compatibility with laravel 5.6, maybe bump the Illuminate/Database version restriction in composer.json?

daniel-werner commented 4 years ago

This also breaks the compatibility with Laravel 5.7, the getQualifiedForeignKeyName was introduced in Laravel 5.8.

krisnaw commented 4 years ago

I'm having the same issue with Laravel 5.5