How to use condtional validation in cakephp 3 ?If checkbox checked validate fields?

I create form with ten fields when i checked one checkbox it validate all fields otherwise it not validate that all fields.

t has many ways to do that. Here I have mentioned the simplest way for it.

 // Assign your checkbox value into $isChecked variable.
$isChecked = $this->request->date['your_check_box'];

// If checked
    // then it will create new entity with validation
    $data = $this->YOUR_MODEL_NAME->newEntity($this->request->date, ['validate' => true]);
    // otherwise it will create new entity without validation
    $data = $this->YOUR_MODEL_NAME->newEntity($this->request->date, ['validate' => false]);

Conditional Validation in Cake is in the book:

Also my tutorial with an example of its use: