How to refresh form fields after action?

I have a very simple action, that looks like this

protected function getActions(): array { return [ Action::make('Cambiar a Creada') ->action(function () { self::$quoteService->changeStateToCreated($this->record->id); $this->refreshFormData([ 'stateId', ]); }) ->requiresConfirmation() ->modalHeading('Finalizar de llenar y crear cotizacion?') ->modalSubheading("Ya no podra revertir los cambios") ->modalButton('Si!') ]; }

My focus is on the 'stateId' which you can't see here, but it's a Select field on the resource. This is the code of the select

Select::make('stateId') ->label('Estado') ->options(QuoteState::all()->pluck('name', 'id')) ->relationship('state', 'name') ->disabled() ->hiddenOn('create'),

When I open the view page, that Select looks fine (like the first picture you see on this post). But when I trigger the action, everything works fine, but the Select now looks like reseted. It looks like it was "deselected" (as you will see in the second picture). Why is that?



Why
image.png
Was this page helpful?