parfum/app/Livewire/Studio/Manage/Purchase/Index.php
Yoga Pangestu 33e138be42 feat(purchase): implementasi fitur belanja/restock
-membuat relasi polimorfirk
-membuat beberapa trait untuk kebutuhan crud
-dan lainnya tentang implementasi fitur ini
2025-10-04 21:09:20 +07:00

36 lines
724 B
PHP

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