kristijanhusak / laravel-form-builder

Laravel Form builder for version 5+!
https://packagist.org/packages/kris/laravel-form-builder
MIT License
1.71k stars 296 forks source link

[Proposal] Public API object oriented #488

Open yanvv2 opened 5 years ago

yanvv2 commented 5 years ago

Currently auto completion is missing due to the use of arrays inside most methods. Are you by any chance looking into making a change to make the project more object oriented?

e.g.

$textField = new TextField('field_name', 'field_id');
$textField->addLabel('This is a label for the text field')
        ->addClass('form-control')
        ->value($prefillValue);

$this->add($textField);

$selectField = new SelectField('select_name', 'select_id');
$selectField->addChoice('en', 'English')
            ->addChoice('fr', 'French')
            ->addLabel('Select field label')
            ->setMultiple(true)

$this->add($selectField);
kristijanhusak commented 5 years ago

Looks good. I don't really have time to do this, so any help is appreciated.