backUrl = url()->previous(); parent::mount($record); } protected function getRedirectUrl(): string // <- return type is string to be compatible with EditRecord & CreateRecord { return $this->backUrl; } protected function getCancelFormAction(): Action { return parent::getCancelFormAction() ->url(fn (Page $livewire) => $livewire->backUrl ?? static::getResource()::getUrl()); } }