parfum/app/Livewire/Studio/Catalog/Perfume/Index.php
Yoga Pangestu 81a9753620 feat(perfume. bottle): implementasi testing
- kasih return type
- ubah array to collection di audit
- mengubah waktu refresh tabel menjadi 30 detik
2025-12-11 11:15:59 +07:00

40 lines
896 B
PHP

<?php
namespace App\Livewire\Studio\Catalog\Perfume;
use App\Models\Perfume;
use App\Traits\Notification\WithSubscribeNotification;
use App\Traits\WithAuthorization;
use App\Traits\WithConfirmation;
use App\Traits\WithShowPrice;
use App\Traits\WithToast;
use Flux\Flux;
use Livewire\Attributes\Title;
use Livewire\Component;
#[Title('Parfum')]
class Index extends Component
{
use WithAuthorization, WithConfirmation, WithShowPrice, WithSubscribeNotification, WithToast;
public function delete(Perfume $perfume)
{
$this->canOrAbort('delete 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',
]);
}
}