Actions

Replicate

Copy a record, leaving out what shouldn't be copied.

use Xelqun\Panels\Actions\ReplicateAction;

ReplicateAction::for(static::class)
    ->excludeAttributes(['slug'])
    ->beforeReplicaSaved(fn (Post $replica) => $replica->title .= ' (copy)');
Replicate in a row menuReplicate in a row menu

excludeAttributes() lists what must not be copied, such as a unique slug. It needs replicate in the policy.

See it in the demo: open the menu on any row.