parfum/app/Livewire/Studio/Catalog/Perfume/Index.php
Yoga Pangestu 700aa8f260 feat(trait): membuat trait untuk toast agar reusable
-mengubah cara menulis toast diubah menjadi memanggil toast yang ada
2025-10-02 20:13:03 +07:00

35 lines
670 B
PHP

<?php
namespace App\Livewire\Studio\Catalog\Perfume;
use App\Models\Perfume;
use App\Traits\WithConfirmation;
use App\Traits\WithToast;
use Flux\Flux;
use Livewire\Attributes\Title;
use Livewire\Component;
#[Title('Parfum')]
class Index extends Component
{
use WithConfirmation, WithToast;
public function delete(Perfume $perfume)
{
$perfume->delete();
$this->dispatch('refreshDatatable');
$this->toast('Parfum berhasil dihapus.');
Flux::modals()->close();
}
public function render()
{
return view('livewire.studio.catalog.perfume.index', [
'pageTitle' => 'Parfum',
]);
}
}