- Introduce `CheerfulNotification` utility class to standardize cheerful and expressive notifications across the application. - Refactor custom "Cheerful" actions (Create, Edit, Delete, etc.) and `DefaultBulkActions` to utilize the new utility class. - Update all `ToggleColumn` status updates in Master Data modules to use `CheerfulNotification::statusUpdated()`. - Replace inline `Notification::make()` calls in custom actions (Reply, Crawl News, Cooperation actions) and Resource Pages with `CheerfulNotification` methods. - Address various lint errors by standardizing the use of the `Auth` facade and improving type hinting for the authenticated `User` model.
35 lines
991 B
PHP
35 lines
991 B
PHP
<?php
|
|
|
|
namespace App\Filament\Actions;
|
|
|
|
use App\Filament\Support\CheerfulNotification;
|
|
use Filament\Actions\DeleteBulkAction;
|
|
use Filament\Actions\ForceDeleteBulkAction;
|
|
use Filament\Actions\RestoreBulkAction;
|
|
|
|
class DefaultBulkActions
|
|
{
|
|
public static function make(string $entity): array
|
|
{
|
|
return [
|
|
DeleteBulkAction::make()
|
|
->modalHeading("Hapus {$entity} yang dipilih")
|
|
->successNotification(
|
|
CheerfulNotification::bulkDelete()
|
|
),
|
|
|
|
ForceDeleteBulkAction::make()
|
|
->modalHeading("Hapus {$entity} yang dipilih")
|
|
->successNotification(
|
|
CheerfulNotification::bulkForceDelete()
|
|
),
|
|
|
|
RestoreBulkAction::make()
|
|
->modalHeading("Pulihkan {$entity} yang dipilih")
|
|
->successNotification(
|
|
CheerfulNotification::bulkRestore()
|
|
),
|
|
];
|
|
}
|
|
}
|