Replicate action with success redirect

This doesn't work because replica is a protected property but it needs to be set for the successRedirectUrl to evaluate it.
ReplicateAction::make()
->using(function ($action, Product $record): Product {
$action->replica = $record->customRelpicate();
return $action->replica;
})
->successRedirectUrl(
fn (Product $replica): string => ProductResource::getUrl('edit', ['record' => $replica])
)
ReplicateAction::make()
->using(function ($action, Product $record): Product {
$action->replica = $record->customRelpicate();
return $action->replica;
})
->successRedirectUrl(
fn (Product $replica): string => ProductResource::getUrl('edit', ['record' => $replica])
)
0 Replies
No replies yetBe the first to reply to this messageJoin