Closed mrleblanc101 closed 7 months ago
Oh, I think I can just use ->hide()
on the BelongsTo field.
But I'm not sure why the plugin doesn't just take the first ->belongsTo
in the Model instead of the Resource, or the public function parent()
if it's defined, but I'm pretty new to this so I might be confusing some things.
BelongsTo::make(...)->hide()
doesn't work after all because Nova won't fill or save the value if it's hidden.
So I get an error.
Ah, firgured it out. I was duplicating my belongsTo like so:
Instead of referencing the existing belongsTo:
Even thought it's very clear in the documentation. https://github.com/Formfeed-UK/nova-breadcrumbs?tab=readme-ov-file#general
Currently, my breadcrumbs is constructed from the first
BelongsTo::make
found on the Resource. This resource is not shown in the main menu, and can only be create via relationship. I don't want to add aBelongsTo
as it adds a field when I create the Resource via a relationship (default to the viaResourceId value but still). So instead, I create aparent()
public method on my Model, but it does nothing. Am I misunderstanding something ? How would I hide the field and still have the proper breadcrumbs.