src/Taxonomy/TaxonomyField.php
protected function save()
    {
        return function ($term_id) {
            /** @var Validator $validator */
            $validator = $this->validator->make(
                $this->getTermData(app('request')),
                $this->getTermRules(),
                $this->getTermMessages(),
                $this->getTermPlaceholders()
            );

            $validation = $validator->valid();

            foreach ($this->repository->all() as $field) {
                /** @var FieldTypeInterface|BaseType|CanHandleTerms $field */
                $field->setErrorMessageBag($validator->errors());

                if (method_exists($field, 'termSave')) {
                    $field->termSave($validation[$field->getName()] ?? null, $term_id);
                } else {
                    throw new TaxonomyException(
                        'Unable to save ['.$field->getName().']. The [termSave] method is missing.'
                    );
                }
            }
        };
    }
protected function save()
    {
        return function ($term_id) {
            /** @var Validator $validator */
            $validator = $this->validator->make(
                $this->getTermData(app('request')),
                $this->getTermRules(),
                $this->getTermMessages(),
                $this->getTermPlaceholders()
            );

            $validation = $validator->valid();

            foreach ($this->repository->all() as $field) {
                /** @var FieldTypeInterface|BaseType|CanHandleTerms $field */
                $field->setErrorMessageBag($validator->errors());

                if (method_exists($field, 'termSave')) {
                    $field->termSave($validation[$field->getName()] ?? null, $term_id);
                } else {
                    throw new TaxonomyException(
                        'Unable to save ['.$field->getName().']. The [termSave] method is missing.'
                    );
                }
            }
        };
    }
protected function save ( ) { return function ( $ term_id ) { /** @var Validator $validator */ $ validator = $ this -> validator -> make ( $ this -> getTermData ( app ( 'request' ) ) , $ this -> getTermRules ( ) , $ this -> getTermMessages ( ) , $ this -> getTermPlaceholders ( ) ) ; $ validation = $ validator -> valid ( ) ; foreach ( $ this -> repository -> all ( ) as $ field ) { /** @var FieldTypeInterface|BaseType|CanHandleTerms $field */ $ field -> setErrorMessageBag ( $ validator -> errors ( ) ) ; if ( method_exists ( $ field , 'termSave' ) ) { $ field -> termSave ( $ validation [ $ field -> getName ( ) ] ?? null , $ term_id ) ; } else { throw new TaxonomyException ( 'Unable to save [' . $ field -> getName ( ) . ']. The [termSave] method is missing.' ) ; } } } ; }
Return the function managing term meta registration.

@return \Closure
Return the function managing term meta registration .