public function relatedPost(ApiRequest $request, $resourceModel)
    {
        $requestModel = $request->asRequestModel();

        $this->validate($requestModel, $this->getCreatingRules());

        $ids = (array)$requestModel->id();

        /** @var BelongsToMany $relation */
        $relation = $this->getRelation($resourceModel);
        $this->beforeCreating($ids, $relation);

        $requestModel->map(function (RequestModel $model) use ($relation) {
            $this->createRelationshipModel($relation, $model);
        });

        return $this->getRelation($resourceModel->fresh())->get();
    }