Dependant select in modal form

hi have my main form, from here i have 2 selects one for Brand and one for Item
when i select the Brand (for example Roland) i have the Item select populated with all the Roland instruments
but i can also create new Instrument from here.

A modal form is opened and i create the instrument

Now the difficult part
I want this behaviour
  • select the brand in the main form (ok)
  • open the modal for creating a new instrument (ok)
  • here i have this fields: name, model, BRAND, type
BRAND should be pre-populated with the brand selected in the main form

The code (attached)
```
Solution
 ->default(fn ($livewire) => $livewire->data['brand_id']) 
Was this page helpful?