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

Let user select key for all relationships #4702

Merged

Conversation

MrCrayon
Copy link
Collaborator

@MrCrayon MrCrayon commented Jan 16, 2020

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

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
@MrCrayon MrCrayon force-pushed the fix-hasone-hasmany-foreignkey-hardcoded branch from d7f21c3 to 30b6687 Compare January 17, 2020 03:33
@codecov
Copy link

codecov bot commented Mar 10, 2020

Codecov Report

Merging #4702 into 1.3 will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             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              
Impacted Files Coverage Δ Complexity Δ
src/Http/Controllers/Controller.php 81.29% <100.00%> (+2.09%) 76.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e41cbfc...c6240f1. Read the comment docs.

@emptynick emptynick merged commit 77d7747 into thedevdojo:1.3 Mar 10, 2020
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>
@MrCrayon MrCrayon deleted the fix-hasone-hasmany-foreignkey-hardcoded branch May 12, 2020 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants