src/User/UserField.php
public function save($user_id)
    {
        $validator = $this->validator->make(
            $this->getUserData(app('request')),
            $this->getUserRules(),
            $this->getUserMessages(),
            $this->getUserPlaceholders()
        );

        $validation = $validator->valid();

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

            if (method_exists($field, 'userSave')) {
                $field->userSave($validation[$field->getName()] ?? null, $user_id);
            } else {
                throw new UserException('Unable to save ['.$field->getName().']. The [userSave] method is missing.');
            }
        }
    }
public function save($user_id)
    {
        $validator = $this->validator->make(
            $this->getUserData(app('request')),
            $this->getUserRules(),
            $this->getUserMessages(),
            $this->getUserPlaceholders()
        );

        $validation = $validator->valid();

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

            if (method_exists($field, 'userSave')) {
                $field->userSave($validation[$field->getName()] ?? null, $user_id);
            } else {
                throw new UserException('Unable to save ['.$field->getName().']. The [userSave] method is missing.');
            }
        }
    }
public function save ( $ user_id ) { $ validator = $ this -> validator -> make ( $ this -> getUserData ( app ( 'request' ) ) , $ this -> getUserRules ( ) , $ this -> getUserMessages ( ) , $ this -> getUserPlaceholders ( ) ) ; $ validation = $ validator -> valid ( ) ; foreach ( $ this -> repository -> all ( ) as $ field ) { /** @var FieldTypeInterface|BaseType|CanHandleUsers $field */ $ field -> setErrorMessageBag ( $ validator -> errors ( ) ) ; if ( method_exists ( $ field , 'userSave' ) ) { $ field -> userSave ( $ validation [ $ field -> getName ( ) ] ?? null , $ user_id ) ; } else { throw new UserException ( 'Unable to save [' . $ field -> getName ( ) . ']. The [userSave] method is missing.' ) ; } } }
Save user meta.

By default, the callback always contains the user_id as
the first parameter. In the case of an update profile,
a second parameter is available containing an array
of previous user meta data.

@param int $user_id

@throws UserException
Save user meta .