diff --git a/app/Livewire/Studio/Catalog/Perfume/Create.php b/app/Livewire/Studio/Catalog/Perfume/Create.php index 40e3550..cc35389 100644 --- a/app/Livewire/Studio/Catalog/Perfume/Create.php +++ b/app/Livewire/Studio/Catalog/Perfume/Create.php @@ -40,6 +40,10 @@ public function mount() public function save() { + $this->canOrAbort('create perfume'); + + $this->form->store(); + StorePushNotification::dispatch( PushNotification::all(), [ @@ -48,10 +52,6 @@ public function save() ], ); - $this->canOrAbort('create perfume'); - - $this->form->store(); - $this->dispatch('refreshDatatable'); $this->toast('Parfum berhasil ditambahkan.'); diff --git a/app/Livewire/Studio/Loyalty/Voucher/Create.php b/app/Livewire/Studio/Loyalty/Voucher/Create.php index c852d16..40dcb04 100644 --- a/app/Livewire/Studio/Loyalty/Voucher/Create.php +++ b/app/Livewire/Studio/Loyalty/Voucher/Create.php @@ -29,6 +29,10 @@ public function mount() public function save() { + $this->canOrAbort('create voucher'); + + $this->form->store(); + StorePushNotification::dispatch( PushNotification::all(), [ @@ -37,10 +41,6 @@ public function save() ], ); - $this->canOrAbort('create voucher'); - - $this->form->store(); - $this->toast('Voucher berhasil ditambahkan.'); $this->redirectRoute('studio.loyalty.voucher.index', navigate: true);