Access to an undefined property $form

Inside a custom component with a Filament form how to keep PhpStan happy with error:
Access to an undefined property $form

When I declare it protected $form; the fill method throws error:
Call to a member function fill() on null

Type hinting with form
$form must not be accessed before initialization
Solution
Add a phpdoc /** @property Form $form */ to the class
Was this page helpful?