29 lines
902 B
PHP
29 lines
902 B
PHP
<?php
|
|
|
|
namespace App\Filament\Actions\Cheerful;
|
|
|
|
use App\Enums\NotifStyle;
|
|
use App\Filament\Support\CheerfulNotification;
|
|
use Filament\Actions\DeleteAction as ActionsDeleteAction;
|
|
|
|
class DeleteAction extends ActionsDeleteAction
|
|
{
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->modalHeading(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL
|
|
? 'Betulan Mau Hapus? 🗑️🤔'
|
|
: 'Hapus Data'
|
|
);
|
|
|
|
$this->modalDescription(fn () => CheerfulNotification::getNotifStyle() === NotifStyle::CHEERFUL
|
|
? 'Data ini akan kita lepas ya. Hati-hati, data berelasi juga mungkin bakal ikut berpamitan! 🏃💨'
|
|
: 'Apakah Anda yakin ingin menghapus data ini secara permanen?'
|
|
);
|
|
|
|
$this->successNotification(fn () => CheerfulNotification::delete()
|
|
);
|
|
}
|
|
}
|