| Server IP : 35.80.110.71 / Your IP : 216.73.216.221 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/switchyard/current/vendor/filament/actions/src/ |
Upload File : |
<?php
namespace Filament\Actions;
use Filament\Actions\Concerns\CanCustomizeProcess;
use Filament\Actions\View\ActionsIconAlias;
use Filament\Support\Facades\FilamentIcon;
use Filament\Support\Icons\Heroicon;
use Illuminate\Database\Eloquent\Model;
class DeleteAction extends Action
{
use CanCustomizeProcess;
public static function getDefaultName(): ?string
{
return 'delete';
}
protected function setUp(): void
{
parent::setUp();
$this->label(__('filament-actions::delete.single.label'));
$this->modalHeading(fn (): string => __('filament-actions::delete.single.modal.heading', ['label' => $this->getRecordTitle()]));
$this->modalSubmitActionLabel(__('filament-actions::delete.single.modal.actions.delete.label'));
$this->successNotificationTitle(__('filament-actions::delete.single.notifications.deleted.title'));
$this->defaultColor('danger');
$this->tableIcon(FilamentIcon::resolve(ActionsIconAlias::DELETE_ACTION) ?? Heroicon::Trash);
$this->groupedIcon(FilamentIcon::resolve(ActionsIconAlias::DELETE_ACTION_GROUPED) ?? Heroicon::Trash);
$this->requiresConfirmation();
$this->modalIcon(FilamentIcon::resolve(ActionsIconAlias::DELETE_ACTION_MODAL) ?? Heroicon::OutlinedTrash);
$this->keyBindings(['mod+d']);
$this->hidden(static function (Model $record): bool {
if (! method_exists($record, 'trashed')) {
return false;
}
return $record->trashed();
});
$this->action(function (): void {
$result = $this->process(static fn (Model $record): ?bool => $record->delete());
if (! $result) {
$this->failure();
return;
}
$this->success();
});
}
}