cloner
cloner copied to clipboard
Duplicate attachment from original model
When duplicating an attachment, the attachment of the clone is used as a reference (line 92). https://github.com/BKWLD/cloner/blob/d9c92a1e939805eb51119d63ce6da7aa5680449c/src/Cloner.php#L89-L95
This probably doesn't matter in most cases, but it does with the attachment handler I use. This handler will for example generate the path based on properties of the model, like its key/ID. So in my adapter I cannot get the path of the current existing attachment, because the key is different in the clone.
Duplicating from the original model instead of the clone fixes my issue. It also seems more logical to me to duplicate from an original instead from a clone (which should only receive the duplicate).