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

Persist HasMany Relations #4191

Open
wants to merge 1 commit into
base: 3.1
Choose a base branch
from
Open

Conversation

jackjackde
Copy link

Please take note of our contributing guidelines: https://docs.laravel-excel.com/3.1/getting-started/contributing.html
Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.

1️⃣ Why should it be added? What are the benefits of this change?

  • to persist HasMany Relations

2️⃣ Does it contain multiple, unrelated changes? Please separate the PRs out.

  • nope

3️⃣ Does it include tests, if possible?

  • nope

4️⃣ Any drawbacks? Possible breaking changes?

  • nope

5️⃣ Mark the following tasks as done:

  • Checked the codebase to ensure that your feature doesn't already exist.
  • Take note of the contributing guidelines.
  • Checked the pull requests to ensure that another person hasn't already submitted a fix.
  • Added tests to ensure against regression.

6️⃣ Thanks for contributing! 🙌

Copy link
Member

@patrickbrouwers patrickbrouwers left a comment

Choose a reason for hiding this comment

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

Can you please try and add a test for HasMany. I remember leaving out HasMany for a reason, I currently have no way to determine if this actually works without seeing a working unit test

@@ -98,7 +99,7 @@ private function persistBelongsTo(BelongsTo $relation, array $models): bool
* @param array $models
* @return bool
*/
private function persistBelongsToMany(BelongsToMany $relation, array $models): bool
private function persistToMany(BelongsToMany|HasMany $relation, array $models): bool
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work on older PHP versions which we currently still support

@stale stale bot added the stale label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants