There is FormType1 create FormType2

I am writing a method

 public function getParent() { return FormType1::class; } 

I get in buildForm

 $builder->remove('myfield'); 

Next is the name field with the required attribute

 $builder->get('name'); 

The question is how to remove the required from this field?

    1 answer 1

    It seems you need to override this field, like this:

     $builder->set('name', null, [ 'required' => false, ]);