$this->form->getState() empty
Hi, I've created a Filament page with the make command and I've placed a form inside the component. When I submit my form,
$this->form->getState()
returns an empty array and I'm not sure why. The $data property however is filled correctly, and my validation also runs fine. Any idea what's wrong with my code? Or shouldn't I use $this->form->getState()
and just use $this->data
?
My file:
2 Replies
Solution
if you want to get the relationship data using
getState()
, add ->dehydrated(true)
after ->relationship()