laravel-form-builder icon indicating copy to clipboard operation
laravel-form-builder copied to clipboard

Plain form class check in Form

Open rudiedirkx opened this issue 5 years ago • 0 comments

class Form
    public function rebuildForm() {
        // If form is plain, .....
        if (get_class($this) === 'Kris\LaravelFormBuilder\Form') {

That's not right. The plain form class is configurable, kinda:

class FormBuilder {
    protected $plainFormClass = Form::class;

So checking for 'is plain form' should check for that class.

But currently the FormHelper doesn't have access to the FormBuilder. Even though there is protected $formBuilder; in FormHelper, never used, always null.


  • [ ] Move protected $plainFormClass to real config
  • [ ] Remove protected $formBuilder from FormHelper
  • [ ] Let rebuildForm() check the correct form class

rudiedirkx avatar Mar 05 '19 22:03 rudiedirkx