mpociot / laravel-test-factory-helper

Generate Laravel test factories from your existing models
935 stars 87 forks source link

Fix for Laravel < 5.8 Exception: Call to undefined method BelongsTo::getForeignKeyName() #33

Closed dontfreakout closed 5 years ago

dontfreakout commented 5 years ago

Because of changes in Laravel 5.8, getOwnerKey methods of the BelongsTo relationship have been renamed to getForeignKeyName.

jasonmccreary commented 5 years ago

What version of the package are you running as this should be resolved in v1.0.

dontfreakout commented 5 years ago

v1.0.1

jasonmccreary commented 5 years ago

Sorry, it seems the version of the framework is what's important. I see now what you have added. Thanks. 👍

dontfreakout commented 5 years ago

Yeah, my bad. I should better explain its problem with the older framework. :-) I'm happy to help, thanks for this package.

jasonmccreary commented 5 years ago

No worries. @mpociot made this years ago, I just stumbled upon it this week and tried to update it. 😅

Thanks for the fix!