// form schema for edit order in relation manager
// other form info
Actions::make([
Action::make('submitThisMeal')
->label('Submit')
->action(function () {
// handle submission and create selection
})
->after(function ($livewire) {
$livewire->dispatch('refreshModal');
})
// OrdersRelationManager
#[On('refreshModal')]
public function refresh(): void
{
// unset the form
unset($this->cachedForms['mountedTableActionForm']);
// reload the form
$this->cacheForm('mountedTableActionForm', null);
// application logic to find new selection...
// set form with new data
$this->mountedTableActionsData[0]['existingSelectionInfo'][$selection->meal->menuCategory->name][$selectionIndex]['mealId'] = $selection->meal_id;
}
}
// form schema for edit order in relation manager
// other form info
Actions::make([
Action::make('submitThisMeal')
->label('Submit')
->action(function () {
// handle submission and create selection
})
->after(function ($livewire) {
$livewire->dispatch('refreshModal');
})
// OrdersRelationManager
#[On('refreshModal')]
public function refresh(): void
{
// unset the form
unset($this->cachedForms['mountedTableActionForm']);
// reload the form
$this->cacheForm('mountedTableActionForm', null);
// application logic to find new selection...
// set form with new data
$this->mountedTableActionsData[0]['existingSelectionInfo'][$selection->meal->menuCategory->name][$selectionIndex]['mealId'] = $selection->meal_id;
}
}