code: protected function dataForUpdate($record, array $document): array
      {
          $resource = $document['data'] ?? [];
  
          if ($this->mustValidateExisting($record, $document)) {
              $resource['attributes'] = $this->extractAttributes(
                  $record,
                  $resource['attributes'] ?? []
              );
  
              $resource['relationships'] = $this->extractRelationships(
                  $record,
                  $resource['relationships'] ?? []
              );
          }
  
          return $resource;
      }
docs: Get validation data for updating a domain record.
  
  The JSON API spec says:
  
  > If a request does not include all of the attributes for a resource,
  > the server MUST interpret the missing attributes as if they were included
  > with their current values. The server MUST NOT interpret missing
  > attributes as null values.
  
  So that the validator has access to the current values of attributes, we
  merge attributes provided by the client over the top of the existing attribute
  values.
  
  @param mixed $record
  the record being updated.
  @param array $document
  the JSON API document to validate.
  @return array