Refresh Form after suffix action
I want to refresh the form after a suffix action has been fired.
1 Reply
->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??
})
])
$action->getLivewire()->dispatch('$refresh');
$action->getLivewire()->dispatch('$refresh');