Skip to content

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

Open
vahidRP wants to merge 1 commit intojackabox:masterfrom
vahidRP:master
Open

[FEATURE] Now duplicate field supports nearly all relations#20
vahidRP wants to merge 1 commit intojackabox:masterfrom
vahidRP:master

Conversation

@vahidRP
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@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