The copy keeps the content, stack and team, but is unpublished, out of any review, and gets a title marked as a copy and a free slug. It replaces Filament's replicate action, which left the copy without a slug and still published. The same copy is available through the API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
759 B
PHP
30 lines
759 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\Services\Pages;
|
|
|
|
use App\Filament\Concerns\WarnsOfConcurrentEditing;
|
|
use App\Filament\Resources\Services\ServiceResource;
|
|
use App\Filament\Support\DuplicateAction;
|
|
use App\Filament\Support\PreviewAction;
|
|
use Filament\Actions\DeleteAction;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditService extends EditRecord
|
|
{
|
|
use WarnsOfConcurrentEditing;
|
|
|
|
protected static string $resource = ServiceResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
// Seeing it on the real site without leaving the form.
|
|
PreviewAction::for('service'),
|
|
DuplicateAction::make(),
|
|
DeleteAction::make(),
|
|
];
|
|
}
|
|
}
|