FilamentF
Filament3y ago
3 replies
Chrispian

successRedirectUrl to edit page on replicate()

I want to redirect to the CLONED edit page after I replicate. We don't have the ID until it's cloned, so will this work? I'e tried using successRedirectUrl and I can send it anywhere I want so that obviously works. Just not to the edit page. The error I get is that the $record parameter is missing. Here is my code (based on the code from the docs)

ReplicateAction::make()
    ->successRedirectUrl(fn (Tile $replica): string => route('tiles.edit', [
        'tile' => $replica,
    ]))

I've tried multiple variations, tried injecting record (which did work, but it was the ORIGINAL record. I need the cloned record.

It seems like I should be able to new up record from the replicate but I couldn't get that to work either.

Any suggestions to try here? Is this maybe something to be done via Livewire? Stuck on this one.
Was this page helpful?