Add parent relation dropdown

Howdy October People

I want to add a parent dropdown to my tailor structure:

        type: relation
        optionsMethod: App\Provider::getParentIdOptions
        options: App\Provider::getParentIdOptions
        label: Parent
        nameFrom: name
        span: auto

Using it like this, the current parent is not preselected, and the value is not saved. Changing the field name to parent_id makes it disappear completely.

How would one add a custom parent selector dropdown to a Tailor blueprint?

1 Like

I’m sorry I discovered the secondaryFields UI under the 3 dots. That’s why the field parent_id wasn’t rendered.

1 Like

Hey @Feerena

Something that may be of interest: The recordfinder tailor field can be used to associate with regular model classes. This can be rendered as a relation with displayMode: relation. Here are the docs on this field:

1 Like