code: protected function dataForRelationship($record, string $field, array $document): array
      {
          $schema = $this->container->getSchema($record);
  
          return [
              'type' => $schema->getResourceType(),
              'id' => $schema->getId($record),
              'relationships' => [
                  $field => [
                      'data' => $document['data'],
                  ],
              ],
          ];
      }
docs: Get validation data for modifying a relationship.
  
  @param mixed $record
  @param string $field
  @param array $document
  @return array