Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 197 forks source link

add missing `getForeignKeyName` method #286

Closed dgerike closed 6 years ago

dgerike commented 6 years ago

This fixes the issue with the belongsTo method, as described in https://github.com/Vinelab/NeoEloquent/issues/281.

Code is copy-pasted from the \Illuminate\Database\Eloquent\Relations\HasOneOrMany class. No good style, I know, but it was the least invasive way to solve the immediate problem.

I tested it locally (works for all of my use cases) and Travis is still happy, too (https://travis-ci.org/dgerike/NeoEloquent/).

ozziexsh commented 6 years ago

Was having the same issue as #281 and this change fixed it 👍

Should it maybe reference the method implementation from the actual Illuminate\Database\Eloquent\Relations\BelongsTo though? Just a thought.