parfum/app/Livewire/Studio/Loyalty/Voucher/Create.php
Yoga Pangestu 0f7d1a131d feat(voucher): membuat crud
-menambahkan enum untuk tipe diskon persentase atau fixed
-membuat tabel, form, migrasi, model dll sesuai dengan kebutuhan fitur
2025-09-28 21:34:47 +07:00

41 lines
844 B
PHP

<?php
namespace App\Livewire\Studio\Loyalty\Voucher;
use App\Livewire\Forms\VoucherForm;
use App\Traits\WithUpdatedData;
use Flux\Flux;
use Livewire\Attributes\Title;
use Livewire\Component;
#[Title('Tambah Voucher')]
class Create extends Component
{
use WithUpdatedData;
public VoucherForm $form;
public function save()
{
$this->form->store();
$this->dispatch('refreshDatatable');
Flux::toast(
heading: 'Berhasil',
text: 'Voucher berhasil ditambahkan.',
variant: 'success',
duration: 3000
);
$this->redirectRoute('studio.loyalty.voucher.index', navigate: true);
}
public function render()
{
return view('livewire.studio.loyalty.voucher.form', [
'pageTitle' => 'Tambah Voucher',
]);
}
}