F
Filament17mo ago
Marnick

Can't set model as property if it hasn't been persisted yet

I am using this function:
public function deleteAction(): Action
{
return DeleteAction::make()
->record($this->request)
->successRedirectUrl(route('requests'));
}
public function deleteAction(): Action
{
return DeleteAction::make()
->record($this->request)
->successRedirectUrl(route('requests'));
}
The page (full screen livewire component) that contains this function shows the details of the record (Request, has nothing to do with HTTP requests but is just a model) and to be able view the page, the Request has to exist (of course). When I click the confirm button in the modal, I get the error Can't set model as property if it hasn't been persisted yet. But the record is deleted in the database. To me, it seems like the page breaks before the redirect because the Request doesn't exist anymore. Is this a bug, or am I doing something wrong?
2 Replies
Patrick Boivin
Patrick Boivin17mo ago
Can you click the SHARE link at the top of the error page? Not sure what is causing this.
Marnick
MarnickOP17mo ago
Flare
Can't set model as property if it hasn't been persisted yet - The error occurred at http://safesent.test/dashboard/aanvragen/af9d2e77-3137-41ac-ab01-0302132a0d1e
Want results from more Discord servers?
Add your server