Back

Conditional Validation in Laravel (If some field has value,then apply validation)

Copy Below Code View As A Text File Show Text Only Show API Edit Code
                            

// if Field has value "Major" do not apply then will use "exclude_if" 'parent_first_name'=>'exclude_if:user_type,major|required', // if Field has value "Major" then apply only , will use "exclude_unless" 'parent_first_name'=>'exclude_unless:user_type,major|required',