diff --git a/Livewire/Currency/CurrencyModal.php b/Livewire/Currency/CurrencyModal.php index d0d1141..84ee2b2 100644 --- a/Livewire/Currency/CurrencyModal.php +++ b/Livewire/Currency/CurrencyModal.php @@ -21,6 +21,7 @@ protected $listeners = [ 'delete' => 'delete', 'update' => 'update', + 'reload' => 'reload', ]; public function render() @@ -142,6 +143,12 @@ } } + public function reload() + { + $this->edit_mode = false; + $this->reset(); + } + public function hydrate() { $this->resetErrorBag(); diff --git a/Resources/views/parameter/currencies/index.blade.php b/Resources/views/parameter/currencies/index.blade.php index 1f6edda..1608172 100644 --- a/Resources/views/parameter/currencies/index.blade.php +++ b/Resources/views/parameter/currencies/index.blade.php @@ -92,6 +92,11 @@ LaravelDataTables['currency-table'].ajax.reload(); }); }); + + $('#kt_modal_add_currency').on('hidden.bs.modal', function () { + $(this).find('form').trigger('reset'); + Livewire.dispatch('reload', false); + }) @endpush