From df415813858f059828e5a7ed156f74f4c1292694 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 25 Sep 2025 19:22:36 +0700 Subject: [PATCH] feat(trait): membuat reusable close modal --- app/Traits/WithCloseModal.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/Traits/WithCloseModal.php diff --git a/app/Traits/WithCloseModal.php b/app/Traits/WithCloseModal.php new file mode 100644 index 0000000..2b1d581 --- /dev/null +++ b/app/Traits/WithCloseModal.php @@ -0,0 +1,23 @@ +resetErrorBag(); + $this->resetValidation(); + $this->reset(); + + if ($isCloseAll) { + Flux::modals()->close(); + + return; + } + + Flux::modals($modalName)->close(); + } +}