parfum/app/Livewire/Studio/Manage/Article/Index.php

36 lines
753 B
PHP

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