{"action":"created","issue":{"url":"https://api.github.com/repos/cloudcreativity/laravel-json-api/issues/141","repository_url":"https://api.github.com/repos/cloudcreativity/laravel-json-api","labels_url":"https://api.github.com/repos/cloudcreativity/laravel-json-api/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/cloudcreativity/laravel-json-api/issues/141/comments","events_url":"https://api.github.com/repos/cloudcreativity/laravel-json-api/issues/141/events","html_url":"https://github.com/cloudcreativity/laravel-json-api/issues/141","id":294695035,"number":141,"title":"Question: Is there a way to put limit includes to single resource requests","user":{"login":"spawnia","id":12158000,"avatar_url":"https://avatars2.githubusercontent.com/u/12158000?v=4","gravatar_id":"","url":"https://api.github.com/users/spawnia","html_url":"https://github.com/spawnia","followers_url":"https://api.github.com/users/spawnia/followers","following_url":"https://api.github.com/users/spawnia/following{/other_user}","gists_url":"https://api.github.com/users/spawnia/gists{/gist_id}","starred_url":"https://api.github.com/users/spawnia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spawnia/subscriptions","organizations_url":"https://api.github.com/users/spawnia/orgs","repos_url":"https://api.github.com/users/spawnia/repos","events_url":"https://api.github.com/users/spawnia/events{/privacy}","received_events_url":"https://api.github.com/users/spawnia/received_events","type":"User","site_admin":false},"labels":[{"id":257992123,"url":"https://api.github.com/repos/cloudcreativity/laravel-json-api/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-06T09:53:31Z","updated_at":"2018-02-21T08:35:11Z","closed_at":"2018-02-21T08:35:11Z","author_association":"NONE","body":"What i would like to achieve is that i do not get all the includes when calling the endpoint for the collection of resources, but include more detailed information when accessing a single resource. For example:\r\n\r\n### /posts\r\n\r\n````json\r\n{  \r\n   \"data\":[  \r\n      {  \r\n         \"type\":\"posts\",\r\n         \"id\":\"1\",\r\n         \"attributes\":{  \r\n            \"name\":\"My Post\"\r\n         },\r\n         \"relationships\":{  \r\n            \"author\":{  \r\n               \"data\":{  \r\n                  \"type\":\"authors\",\r\n                  \"id\":\"1\"\r\n               },\r\n               \"links\":{  \r\n                  \"related\":\"http://blog.com/api/v1/posts/1/author\"\r\n               }\r\n            }\r\n         },\r\n         \"links\":{  \r\n            \"self\":\"http://blog.com/api/v1/posts/1\"\r\n         }\r\n      }\r\n   ]\r\n}\r\n````\r\n### /posts/1\r\n````json\r\n{  \r\n   \"data\":{  \r\n      \"type\":\"posts\",\r\n      \"id\":\"1\",\r\n      \"attributes\":{  \r\n         \"name\":\"My Post\"\r\n      },\r\n      \"relationships\":{  \r\n         \"author\":{  \r\n            \"data\":{  \r\n               \"type\":\"authors\",\r\n               \"id\":\"1\"\r\n            },\r\n            \"links\":{  \r\n               \"related\":\"http://blog.com/api/v1/posts/1/author\"\r\n            }\r\n         }\r\n      },\r\n      \"links\":{  \r\n         \"self\":\"http://blog.com/api/v1/posts/1\"\r\n      }\r\n   },\r\n   \"included\":[  \r\n      {  \r\n         \"type\":\"authors\",\r\n         \"id\":\"1\",\r\n         \"attributes\":{  \r\n            \"name\":\"My Author\"\r\n         }\r\n      }\r\n   ]\r\n}\r\n````\r\n\r\nI would like to avoid using the include parameters. I tried getting the information about what kind of call was made in my `getRelationships()` method, but did not get anything.\r\n\r\nIf it is not easily possible, i can use include for that and you can simply close the issue! Thanks"},"comment":{"url":"https://api.github.com/repos/cloudcreativity/laravel-json-api/issues/comments/367250410","html_url":"https://github.com/cloudcreativity/laravel-json-api/issues/141#issuecomment-367250410","issue_url":"https://api.github.com/repos/cloudcreativity/laravel-json-api/issues/141","id":367250410,"user":{"login":"spawnia","id":12158000,"avatar_url":"https://avatars2.githubusercontent.com/u/12158000?v=4","gravatar_id":"","url":"https://api.github.com/users/spawnia","html_url":"https://github.com/spawnia","followers_url":"https://api.github.com/users/spawnia/followers","following_url":"https://api.github.com/users/spawnia/following{/other_user}","gists_url":"https://api.github.com/users/spawnia/gists{/gist_id}","starred_url":"https://api.github.com/users/spawnia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spawnia/subscriptions","organizations_url":"https://api.github.com/users/spawnia/orgs","repos_url":"https://api.github.com/users/spawnia/repos","events_url":"https://api.github.com/users/spawnia/events{/privacy}","received_events_url":"https://api.github.com/users/spawnia/received_events","type":"User","site_admin":false},"created_at":"2018-02-21T08:35:11Z","updated_at":"2018-02-21T08:35:11Z","author_association":"NONE","body":"Hey, just got back to the project and tested your code - it works beautifully, thank you.\r\n\r\nHaving the `json_api_request()` helper available opens up so much more possibilities, great to know!"}}
{"actor":{"display_login":"spawnia"}}