Marnick
Marnick
FFilament
Created by Marnick on 8/2/2023 in #❓┊help
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?
3 replies