stats = [ [ 'title' => 'Total Voucher', 'value' => Voucher::count(), ], [ 'title' => 'Voucher Aktif', 'value' => Voucher::query()->active()->count(), ], [ 'title' => 'Voucher Tidak Aktif', 'value' => Voucher::query()->inactive()->count(), ], [ 'title' => 'Voucher Akan Datang', 'value' => Voucher::query()->upcoming()->count(), ], ]; } public function delete(Voucher $voucher) { $voucher->delete(); $this->dispatch('refreshDatatable'); $this->toast('Voucher berhasil dihapus.'); Flux::modals()->close(); } public function render() { return view('livewire.studio.loyalty.voucher.index', [ 'pageTitle' => 'Voucher', ]); } }