Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Use getter method for access primary key #25303

Merged
merged 1 commit into from
Aug 23, 2018
Merged

[5.5] Use getter method for access primary key #25303

merged 1 commit into from
Aug 23, 2018

Conversation

JeroenVanOort
Copy link
Contributor

Copy of PR #23362, for the 5.5 branch.

We would like to use a package that overrides getKeyName on a model. This works for the primary keys. But, because getForeignKey is using the primaryKey property directly, it doesn't work for relations. This means that when getKeyName returns 'uuid' on a model called Book, getForeignKey would still return 'book_id' instead of 'book_uuid`.

@taylorotwell taylorotwell merged commit 850b753 into laravel:5.5 Aug 23, 2018
EspadaV8 pushed a commit to intellihr/framework that referenced this pull request Jan 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants