final protected function addRequiredAttributeToFields(array $specifications)
    {
        /** @var array $data */
        foreach ($specifications as $field => $data) {
            if (!$this->has($field)) {
                continue;
            }

            $validators = ArrayUtils::get($data, 'validators', []);
            $isRequired = (bool) ArrayUtils::get(
                $data,
                'required',
                ArrayUtils::get($validators, NotEmpty::class, ArrayUtils::get($validators, 'NotEmpty'))
            );

            if ($isRequired) {
                $this->get($field)->setAttribute('required', 'required');
            }
        }

        return $this;
    }