-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Let user select key for all relationships #4702
Merged
emptynick
merged 4 commits into
thedevdojo:1.3
from
MrCrayon:fix-hasone-hasmany-foreignkey-hardcoded
Mar 10, 2020
Merged
Let user select key for all relationships #4702
emptynick
merged 4 commits into
thedevdojo:1.3
from
MrCrayon:fix-hasone-hasmany-foreignkey-hardcoded
Mar 10, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Right now the key to store is selectable only for BelongsTo relationships. For other types the property `key` is still saved taking the first column of the table, but it can't be chosen. This PR also adds support for more advanced parameters in BelongsToMany relationships, there is no interface yet so they need to be set in the details field, once implemented within the graphic interface they'll simply disappear from details field like the other relationship parameters. Closes thedevdojo#2648
d7f21c3
to
30b6687
Compare
andre4nap
approved these changes
Mar 1, 2020
emptynick
approved these changes
Mar 10, 2020
Codecov Report
@@ Coverage Diff @@
## 1.3 #4702 +/- ##
============================================
+ Coverage 60.22% 60.36% +0.13%
Complexity 1370 1370
============================================
Files 194 194
Lines 3970 3984 +14
============================================
+ Hits 2391 2405 +14
Misses 1579 1579
Continue to review full report at Codecov.
|
MrCrayon
added a commit
to MrCrayon/voyager
that referenced
this pull request
Apr 5, 2020
In thedevdojo#4702 I exchanged related_key with parent_key. The one set with graphic interface is related_key and the one that can be set in BREAD details is parent_key https://github.com/laravel/framework/blob/7.x/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L142 Fixes thedevdojo#4845
emptynick
added a commit
that referenced
this pull request
Apr 5, 2020
In #4702 I exchanged related_key with parent_key. The one set with graphic interface is related_key and the one that can be set in BREAD details is parent_key https://github.com/laravel/framework/blob/7.x/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L142 Fixes #4845 Co-authored-by: Christoph Schweppe <info@cschweppe.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now the key to store is selectable only for BelongsTo relationships.
For other types the property
key
is still saved taking the first column of the table, but it can't be chosen.This PR also adds support for more advanced parameters in BelongsToMany relationships, there is no interface yet so they need to be set in the details field, once implemented within the graphic interface they'll simply disappear from details field like the other relationship parameters.
Closes #2648
Closes #2951
Closes #4795