Refresh Form after suffix action

I want to refresh the form after a suffix action has been fired.
1 Reply
BlackShadow
BlackShadow8mo ago
->suffixActions([
Action::make('synchronizeIndentification')
->visible(fn(Profile $record) => $record->identification)
->icon('heroicon-o-arrow-path')
->modalIconColor('warning')
->iconSize('sm')
->requiresConfirmation()
->modalDescription('This is a test')
->action(function (SynchronizeProfile $synchronizeProfile, Profile $record) {
$synchronizeProfile = $synchronizeProfile->indentification($record);

Notification::make()
->title($synchronizeProfile ? __('Identification synchronized')
: __('Something went wrong'))
->status($synchronizeProfile ? 'success' : 'danger')
->send();
// Refresh??
})
])
->suffixActions([
Action::make('synchronizeIndentification')
->visible(fn(Profile $record) => $record->identification)
->icon('heroicon-o-arrow-path')
->modalIconColor('warning')
->iconSize('sm')
->requiresConfirmation()
->modalDescription('This is a test')
->action(function (SynchronizeProfile $synchronizeProfile, Profile $record) {
$synchronizeProfile = $synchronizeProfile->indentification($record);

Notification::make()
->title($synchronizeProfile ? __('Identification synchronized')
: __('Something went wrong'))
->status($synchronizeProfile ? 'success' : 'danger')
->send();
// Refresh??
})
])
This updates the title of the page but the fields are still empty. (hard refresh obv works)
$action->getLivewire()->dispatch('$refresh');
$action->getLivewire()->dispatch('$refresh');