public function addNested($field, Validator $validator, $message = null, $when = null)
    {
        $extra = array_filter(['message' => $message, 'on' => $when]);

        $validationSet = $this->field($field);
        $validationSet->add(static::NESTED, $extra + ['rule' => function ($value, $context) use ($validator, $message) {
            if (!is_array($value)) {
                return false;
            }
            foreach ($this->providers() as $provider) {
                $validator->setProvider($provider, $this->getProvider($provider));
            }
            $errors = $validator->errors($value, $context['newRecord']);

            $message = $message ? [static::NESTED => $message] : [];

            return empty($errors) ? true : $errors + $message;
        }]);

        return $this;
    }