staudenmeir / belongs-to-through

Laravel Eloquent BelongsToThrough relationships
MIT License
1.15k stars 88 forks source link

Custom Local Key Names #40

Closed nathanheffley closed 5 years ago

nathanheffley commented 5 years ago

It looks like support for custom local key column names was removed at some point.

It would be a breaking change but I have a local branch that would change the local keys parameter that is currently ignored into an array that would function similarly to the foreign key lookup array.

Currently this package isn't sufficient for complex relationships where some relationships don't rely on a model's primary key. Would you be open to releasing a new version that supports custom key names if I opened the PR?

nathanheffley commented 5 years ago

On the other hand, would you just say that because your HasManyDeep package appears to be better supported that this package is mostly deprecated and users should migrate to your other package if possible?

staudenmeir commented 5 years ago

It looks like support for custom local key column names was removed at some point.

When I took over the package, I noticed that the $localKey parameter didn't actually do anything useful. So I removed most of its occurrences. The remaining ones are only there to prevent breaking changes in method signatures.

On the other hand, would you just say that your HasManyDeep package appears to be better supported that this package is mostly deprecated and users should migrate to your other package if possible?

I have thought about a new release with support for custom local keys but decided against it (for now):

nathanheffley commented 5 years ago

Good to know, thanks!