parfum/app/Livewire/Studio/Catalog/Bottle/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

41 lines
934 B
PHP

<?php
namespace App\Livewire\Studio\Catalog\Bottle;
use App\Models\Bottle;
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 Illuminate\Contracts\View\View;
use Livewire\Attributes\Title;
use Livewire\Component;
#[Title('Botol')]
class Index extends Component
{
use WithAuthorization, WithConfirmation, WithShowPrice, WithSubscribeNotification, WithToast;
public function delete(Bottle $bottle): void
{
$this->canOrAbort('delete bottle');
$bottle->delete();
$this->dispatch('refreshDatatable');
$this->toast('Botol berhasil dihapus.');
Flux::modals()->close();
}
public function render(): View
{
return view('livewire.studio.catalog.bottle.index', [
'pageTitle' => 'Botol',
]);
}
}