-menambahkan enum untuk tipe diskon persentase atau fixed -membuat tabel, form, migrasi, model dll sesuai dengan kebutuhan fitur
38 lines
729 B
PHP
38 lines
729 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Studio\Loyalty\Voucher;
|
|
|
|
use App\Models\Voucher;
|
|
use App\Traits\WithConfirmation;
|
|
use Flux\Flux;
|
|
use Livewire\Attributes\Title;
|
|
use Livewire\Component;
|
|
|
|
#[Title('Voucher')]
|
|
class Index extends Component
|
|
{
|
|
use WithConfirmation;
|
|
|
|
public function delete(Voucher $voucher)
|
|
{
|
|
$voucher->delete();
|
|
|
|
$this->dispatch('refreshDatatable');
|
|
|
|
Flux::toast(
|
|
heading: 'Berhasil',
|
|
text: 'Voucher berhasil dihapus.',
|
|
variant: 'success',
|
|
);
|
|
|
|
Flux::modals()->close();
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.studio.loyalty.voucher.index', [
|
|
'pageTitle' => 'Voucher',
|
|
]);
|
|
}
|
|
}
|