dcasia / nova-inline-morph-to

A Laravel Nova field for displaying morphTo relationship inline.
MIT License
33 stars 15 forks source link

How do you override the names of the morphTo resources? #29

Closed terry-greenlaw closed 3 years ago

terry-greenlaw commented 3 years ago

The demo GIF shows the template drop-down with descriptive options in mixed case. What do I need to set to override those so they are not just the pluralized resource (model?) name? I've tried setting label, title, and name properties on the morphed models and nova resources with no luck.

Thanks for a great and useful add-on functionality for Nova !

terry-greenlaw commented 3 years ago

NM, I dug through the Nova code and figured it out. Another undocumented feature :-)

The types array passed into morphTo() (and therefore inlineMorphTo() ) can be a simple list or a key => value list where the key is the label used for the resource.

Hope this helps someone !