29 lines
610 B
PHP
29 lines
610 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\CommentResource\Pages;
|
|
|
|
use App\Filament\Resources\CommentResource;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditComment extends EditRecord
|
|
{
|
|
protected static string $resource = CommentResource::class;
|
|
|
|
protected function mutateFormDataBeforeSave(array $data): array
|
|
{
|
|
if (!empty($data['reply_content'])) {
|
|
$data['replied_at'] = now();
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\DeleteAction::make(),
|
|
];
|
|
}
|
|
}
|