This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
So I noticed that when you attach a file in the backend the attachment
knows the backend field from the CMS and sets constraints so that you can have multiple files attached to a model.
Would it be possible for basic MorphOne relations to use a similar constraint system to allow for easy multiple instances of a related model?
Last updated
Hmm, I can add the attributes to the MorphOneOrMany trait, but that would break existing MorphOne usage as the field comes directly from and adding an option in the constructor feels messy and would mean messing around with the Model class...
Maybe being able to use the AttachOne relation would be more realistic, who says that an attachment has to be a file!?
1-2 of 2