You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, pls, how to close modal window after create function save/create data ? snippet bellow
I know, dispatch close-modal, but id ?
dispatch("close-modal", id: ?)
thanks a lot
Action
Action::make('dispatchGoods')
->label(__('Create new dispatch'))
->modalHeading(__('Create new dispatch'))
->modalWidth(MaxWidth::TwoExtraLarge)
->modalSubmitAction(false)
->modalCancelAction(false)
->modalContent(
function () {
return view('filament.pages.order.dispatch', ['record' => $this->record]);
}
)
Livewire component create function
public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('dispatched_qty')
->label(__('labels.dispatched_qty'))
->required()
->numeric()->default($this->record['qty']),
])
->statePath('data');
}
public function create(): void
{
$data = $this->form->getState();
if ($data['dispatched_qty'] > $this->record['qty']) {
Notification::make()
->title(__('Dispatch qty is bigger then order item qty!'))
->danger()
->send();
} else {
Dispatch::create([
...
]);
**close modal ???**
};
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Package
Actions
Package Version
3.2.132
How can we help you?
Hi, pls, how to close modal window after create function save/create data ? snippet bellow
I know, dispatch close-modal, but id ?
dispatch("close-modal", id: ?)
thanks a lot
Action
Livewire component create function
Blade
Beta Was this translation helpful? Give feedback.
All reactions