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

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

        $relation = $this->getRelation($resourceModel);

        return $this->createRelationshipModel($relation, $requestModel);
    }
public function relatedPost(ApiRequest $request, $resourceModel)
    {
        $requestModel = $request->asRequestModel();

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

        $relation = $this->getRelation($resourceModel);

        return $this->createRelationshipModel($relation, $requestModel);
    }
public function relatedPost ( ApiRequest $ request , $ resourceModel ) { $ requestModel = $ request -> asRequestModel ( ) ; $ this -> validate ( $ requestModel , $ this -> getCreatingRules ( ) ) ; $ relation = $ this -> getRelation ( $ resourceModel ) ; return $ this -> createRelationshipModel ( $ relation , $ requestModel ) ; }
post request on To-One relationship

@param ApiRequest $request
@param Model $resourceModel
@return Model
@throws \Exception
post request on To - One relationship