Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace Filament\Tables\Actions; use Filament\Actions\Concerns\CanCustomizeProce..
Decoded Output download
<?php
namespace Filament\Tables\Actions;
use Filament\Actions\Concerns\CanCustomizeProcess;
use Filament\Support\Facades\FilamentIcon;
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->color('danger');
$this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');
$this->requiresConfirmation();
$this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');
$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) => $record->delete());
if (! $result) {
$this->failure();
return;
}
$this->success();
});
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace Filament\Tables\Actions;
use Filament\Actions\Concerns\CanCustomizeProcess;
use Filament\Support\Facades\FilamentIcon;
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->color('danger');
$this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash');
$this->requiresConfirmation();
$this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash');
$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) => $record->delete());
if (! $result) {
$this->failure();
return;
}
$this->success();
});
}
}
Function Calls
None |
Stats
MD5 | 521de784ac16b89cec3695f092ff91f6 |
Eval Count | 0 |
Decode Time | 113 ms |