phpstan: Access to an undefined property App\Livewire\RegisterPage::$form.

When creating a form like described in the docs at https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#adding-the-form then I get the following PHPStan message. Is the documentation still up to date or do I have to set it differently? What about autocompletion?
4 Replies
toeknee
toeknee16mo ago
What is the following message? You probably need to define the fields in the model so phpStan knows they exist
wulfheart
wulfheartOP16mo ago
Sorry: phpstan: Access to an undefined property App\Livewire\RegisterPage::$form. But of what type is the $form property? I can't find it in the docs.
ChesterS
ChesterS16mo ago
@wulfheart This is probably the Filament\Forms\Form class
Lara Zeus
Lara Zeus16mo ago
add
/**
* @property mixed $form
*/
/**
* @property mixed $form
*/
on top of the class

Did you find this page helpful?