formers / former

A powerful form builder, for Laravel and other frameworks (stand-alone too)
https://formers.github.io/former/
1.34k stars 205 forks source link

Allow field->required() to receive a boolean #571

Closed dariusj18 closed 6 years ago

dariusj18 commented 6 years ago

Currently the required method marks a field as required, however if I wanted to mark a field as required from a variable, I have to put the call in an if statement.

ex. Former::text('fieldname')->required($bool)

Ideally this will mark a field as not required if it was already set to required if false is passed in.

claar commented 6 years ago

Thanks for the suggestion -- I've added this feature in release 4.1.7.