Default select not being selected
I want to select fields of a select by default
I do this:
And i get this:
13 Replies
When i expected to get by default selected:
you allow multiple so pass it as an array:
->default(['draft'])
Also, it will only work on creation not edit
yeah, on creating im doing it
let me try as array
as array doesnt work neither
Is this a custom component?
no
So you are not using a Custom Livewire component?
What is this on? A Resource?
oh sorry, yeah im not using admin panel, is the form package
Soo it is custom
on the mount function make sure to include:
$this->form->fill();
for creation
yeah im doing the fill when mounting:
i tried to add status too:
Right so that's likely your issue. You are removing it by providing an empty array
but same result
yeah it works now, okay i understand, thanks!
but lets say another select changes, and when it changes i want to fill the status. how would be achieved?
by setting it reactive and setting its value when changes?