Skip to content

[Updated PR#1796] Add Attributes to the Pivot Embed #1952

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

Closed
wants to merge 6 commits into from

Conversation

divine
Copy link
Contributor

@divine divine commented Feb 8, 2020

This PR was recreated from #1796 with updated branch and resolved conflicting files.

--

Adds Attributes to the Pivot Embed,

Currently got the attribute saving, and retrieval.
Just having a few issues when it comes to eager loading

Help would be appreciated

Supersedes: #1794
Fixes: #1618

Co-Authored-By: Adam Allport [email protected]

$id = $model->getKey();
} else {
if ($id instanceof Collection) {
$id = $id->modelKeys();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to rename $id to $idModelKeys and after line to cast into array

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that author of parent PR don't see this function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use this function and remove this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I don't like this implementation at all, it has a tests but implementation isn't following framework conventions, I think it needs complete rewrite from scratch, maybe close this at all?

@divine
Copy link
Contributor Author

divine commented Feb 23, 2020

This is not the best integration that was made. It needs complete rewrite so closing for now.

@divine divine closed this Feb 23, 2020
@divine divine deleted the pr_1796 branch March 5, 2020 23:36
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.

The withPivot fields are getting ignored. Many to Many Hybrid relationship How to use pivot table on many to many?
2 participants