public function relatedItem(
        ResourceManager $resourceManager,
        ApiRequest $request,
        int $version,
        string $resource,
        $id,
        string $relationship,
        $parameter
    )
    {
        $resourceManager->version($version);

        /** @var HandlesRelationshipItemRequest $handler */
        $handler = $this->initializeHandler($resourceManager, $resource . '.' . $relationship, $request,
            HandlesRelationshipItemRequest::class);

        $parameters = $request->asParameters();

        $resourceRepository = $this->initializeRepository($resourceManager, $resource, $parameters);
        $model = $resourceRepository->findOrFail($id);

        $repository = $resourceManager->resolveRepository($resource . '.' . $relationship);

        $result = $handler->relatedItem($model, $parameter, $repository);

        $document = $this->makeDocumentFromResource($resourceManager, $resource . '.' . $relationship, $result,
            $parameters, $handler);

        if (config('json-api.response.relationships.item.links.self', false)) {
            $document->addLink('self', apiRouteRelationship($resource, $id, $relationship, null, $version));
        }
        if (config('json-api.response.relationships.item.links.related', false)) {
            $document->addLink('related', apiRoute($resource, $id));
        }

        return $this->respond($document);
    }