nilportugues / laravel5-jsonapi

Laravel 5 JSON API Transformer Package

Home Page:http://nilportugues.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating resources with relations ignores relations

OskarD opened this issue · comments

An example of creating a resource with a relation can be found here: http://jsonapi.org/format/#crud-creating

{
  "data": {
    "type": "photos",
    "attributes": {
      "title": "Ember Hamster",
      "src": "http://example.com/images/productivity.png"
    },
    "relationships": {
      "photographer": {
        "data": { "type": "people", "id": "9" }
      }
    }
  }
}

In this example, a relationship between the newly created photos resource and an existing photographer should be created. This is not the case, at least with many-to-many relations (That's all I've tested).

With the current implementation, the photos resource is created without the relation.

Sorry @nilportugues I had to abandon the library to make a deadline :( I will let you know if I get the chance to pick it up again!