Styling forms modal forms created with createOptionsForm()

I have a modal for creating contacts, if a company does not exist, I want to be able to create on on the fly so I am using createOptionsForm() to create it in situ.

I am trying to styling it rather simply but I am struggling to get it to work correctly and I am unsure if it is possible or if I am barking up the wrong tree. I have attached a screenshot and the code is below:

Select::make('company_id')
->relationship('company', 'name')
->searchable()
->preload()
->placeholder('Select a company')
->columns(12)
->createOptionForm([
    TextInput::make('name')
        ->required()
        ->maxLength(255)
        ->columnSpan(12)
        ->label('Company Name'),
    TextInput::make('addr_line_1')
        ->columnSpan(2)
        ->required()
        ->columnSpan(6)
        ->maxLength(255),
    TextInput::make('addr_line_2')
        ->columnSpan(6)
        ->maxLength(255),
    //....
]),


I removed some of the inputs to keep it short.
image.png
Was this page helpful?