Why Not Custom Field That Extend Filament Field In Code Quality Tips

In v4.0.0-beta in code quality tips https://filamentphp.com/docs/4.x/resources/code-quality-tips#using-component-classes it suggest that we make a class that return the filament field or column then use that class but I think that there is better tip is to suggest that we use OOP stuff which is "inheritance" like this code

class MonyTextInput extends TextInput
{
    protected function setUp(): void
    {
        parent::setUp();

        $this
            ->label('Monto')
            //...
    }
}


then used that class in our form. Its much better because it will allow us to add more functionality to the column it self and use the existing code that
TextInput
provide in our custom methods. This can be applied to tables columns, infolist entries, actions and more

what do you think?
Was this page helpful?