Skip to content

[FEATURE] Now duplicate field supports nearly all relations #20

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

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

Conversation

vahidRP
Copy link

@vahidRP vahidRP commented Sep 3, 2019

I improved DuplicateController by adding a switch on different relations and handled almost all relations.

switch(get_class($relation_data)){
case BelongsToMany::class:
case MorphToMany::class:
foreach ($items as $item) {
Copy link
Owner

Choose a reason for hiding this comment

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

Probably want to extract these to individual functions to clean up this, when all classes are added it could become hard to read/manage.

Copy link
Author

Choose a reason for hiding this comment

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

As you wish. I think you can merge this changes to this currently version of your repository.

Copy link
Owner

Choose a reason for hiding this comment

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

Seems good, I'll give it a test and double-check

@jackabox jackabox added the enhancement New feature or request label Sep 3, 2019
@jackabox jackabox added this to the Version 1 milestone Sep 3, 2019
Copy link

@mide22 mide22 left a comment

Choose a reason for hiding this comment

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

Works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants