I have a system in laravel 5. I have a Form Request validating the fields of a form with some rules.
And I needed to do the following: I have a tab on the form that registers the members of a company. The user has the option to register or not the members. I have a checkbox that controls this, it comes "false" by default ... Then if the user wants to register the member, he "checks" the checkbox to fill in the data of the members.
I would like to do a function that if the partner checkbox is checked, it does the validation in the fields: - name, - participation. Otherwise, it does not do validation in these fields.
I saw a way to create a ServiceProvider for this, but how do I get the field "checkboxes" and check if it has value inside a Request in laravel?