How to disabled select in form
i have this code
Select::make('status')
->label('Status')
->required()
->options(collect(InvitationStatus::getValues())
->filter()
->mapWithKeys(fn ($value) => [$value => ucfirst($value)])
->toArray()
)
->default(InvitationStatus::PENDING->value)
->afterStateHydrated(fn ($set, $state) => $state ?: $set(InvitationStatus::PENDING->value)),
but i want to select this disabled,when i try to add '->disabled()' it gets error "General error: 1364 Field 'status' doesn't have a default value" can someone help me
Solution:Jump to solution
Using ->dehydrated() at the end ensures the field is included in form submission even when disabled
1 Reply
Solution
Using ->dehydrated() at the end ensures the field is included in form submission even when disabled