-membuat relasi polimorfirk -membuat beberapa trait untuk kebutuhan crud -dan lainnya tentang implementasi fitur ini
36 lines
724 B
PHP
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',
|
|
]);
|
|
}
|
|
}
|