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

How to copy (duplicate) attachments from one model to another? #74

Open
kwazaro opened this issue Mar 5, 2019 · 0 comments
Open

How to copy (duplicate) attachments from one model to another? #74

kwazaro opened this issue Mar 5, 2019 · 0 comments

Comments

@kwazaro
Copy link

kwazaro commented Mar 5, 2019

I have model with attachments:

$model = Page::findOne($id);

I want to duplicate this model and all it's attachments:

$newModel = new Page();
$newModel->setAttributes($model->attributes);
$newModel->save();

How to deal with attachments here?

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

No branches or pull requests

1 participant