Got a question. Is it possible to “Extend” blueprints? Say, for instance, I got a blueprint called “Services” and I want to add a field, but I don’t want to edit the original blueprint file.
Could I do the following?
Create a new blueprint with the same UUID and Handle
It is not currently possible, although this is an interesting idea.
The load order would not be predictable to make identical blueprint files merge like this. For example, there is no way to know which name will be used for these files:
# blueprint1.yaml
uuid: ae2d2c25-3a0e-4765-8b36-d1666fc0e31f
handle: Fields\SocialLinks
name: Wiki Article
# blueprint2.yaml
uuid: ae2d2c25-3a0e-4765-8b36-d1666fc0e31f
handle: Fields\SocialLinks
name: Blog Article
Assuming this would be controlled by having a base blueprint defining all the fields and an extended blueprint only defining the newly introduced elements:
That’s what I was planning on doing. I figured there would be some caveat to this.
The end goal would be to just pile fields on top of the ones we have now so that the original structure stays the same. Since it’s not predictable, I don’t think I would do it.
Also, the idea behind this would be similar to applying migrations using a plugin or Laravel’s existing migration techniques. Basically, you’re working on something, and decide that you need another database entry, so you extend it with a migration and add that field.