#Can I get the value of a select and run a method? Not ubmitting a form.
16 messages · Page 1 of 1 (latest)
Select::make('contact.status'). //
->live()
->options(StatusEnum::class)
->afterStateUpdated(
function ($state) {
logger('Here save new status!');
})
$state is the value of the form field
You would expect the logger in laravel.log and I don't get anything. As if the state is not Updating
Funny, I just tried that, no dd().
no javascript errors on browser console?
THis is in a class EditWindow extends Component implements HasForms, HasActions
so oes that make difference?
if the form is configured correctly I dont think theres a problem.
Javascrip error Uncaught TypeError: Cannot read properties of null (reading 'status')
So it is broken before selection. I have to populate the status first.
I made a local public $status for the status and now I see it in dd()
Nice
Thank you for marking this question as solved!
Learn more