Skip to content

[5.6] Use getter method for access primary key#23362

Merged
taylorotwell merged 1 commit into
laravel:5.6from
mayoz:patch-2
Mar 2, 2018
Merged

[5.6] Use getter method for access primary key#23362
taylorotwell merged 1 commit into
laravel:5.6from
mayoz:patch-2

Conversation

@mayoz

@mayoz mayoz commented Mar 1, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@sisve

sisve commented Mar 2, 2018

Copy link
Copy Markdown
Contributor

What problem does this solve, and where are the tests for that problem?

@mayoz

mayoz commented Mar 2, 2018

Copy link
Copy Markdown
Contributor Author

You can't change the primaryKey value in traits, PHP does not allow this for now. But you can override with method. Also, Laravel tests getKeyName method in the DatabaseEloquentModelTest.php

@jmarcher

jmarcher commented Mar 2, 2018

Copy link
Copy Markdown
Contributor

What @sisve means is that you changed the getForeignKey method, those changes need to be tested.

Something like the use case you said could be tested.

@taylorotwell
taylorotwell merged commit a35c52d into laravel:5.6 Mar 2, 2018
@mayoz
mayoz deleted the patch-2 branch March 2, 2018 15:25
@GrahamCampbell GrahamCampbell changed the title Use getter method for access primary key [5.6] Use getter method for access primary key Mar 2, 2018
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.

4 participants