adamwathan / bootforms

Rapid form generation with Bootstrap 3 and Laravel.
MIT License
417 stars 103 forks source link

Support for ->required() on the label within a form group #132

Closed clemblanco closed 7 years ago

clemblanco commented 7 years ago

By intercepting the required($conditional) function here we will add automatically the control-label-required CSS class to the <label> HTML element.

This way you are able to use CSS to style the <label> HTML element however you want, you can even use pseudo-elements to add an asterisk:

label.control-label-required:after {
    content: " *";
}

Obviously we wont interfere with Form Builder and we'll call the required() function defined within adamwathan/form no matter what. The CSS class will just be added conditionally.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.6%) to 89.286% when pulling d94265c420ea866934bf511ac98e96ec92ae1523 on Claymm:master into f593c3304c0ff1df9d30c0582301f5519eb43d73 on adamwathan:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 91.071% when pulling ebd0986145c43721af676dbee0912487b8133b9d on Claymm:master into f593c3304c0ff1df9d30c0582301f5519eb43d73 on adamwathan:master.

clemblanco commented 7 years ago

Anyone pretty please? @adamwathan?

adamwathan commented 7 years ago

Sure why not 🤷‍♂️

clemblanco commented 7 years ago

clemblanco commented 7 years ago

Any chance this goes into a release? Would like to avoid having to use dev-master if possible.

adamwathan commented 7 years ago

Done

clemblanco commented 7 years ago

Amazing! 🎉