{"action":"closed","issue":{"url":"https://api.github.com/repos/yajra/laravel-datatables-demo/issues/10","labels_url":"https://api.github.com/repos/yajra/laravel-datatables-demo/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables-demo/issues/10/comments","events_url":"https://api.github.com/repos/yajra/laravel-datatables-demo/issues/10/events","html_url":"https://github.com/yajra/laravel-datatables-demo/issues/10","id":100752505,"number":10,"title":"Json responce data key not showing data in key value pair","user":{"login":"hassandad","id":10573224,"avatar_url":"https://avatars.githubusercontent.com/u/10573224?v=3","gravatar_id":"","url":"https://api.github.com/users/hassandad","html_url":"https://github.com/hassandad","followers_url":"https://api.github.com/users/hassandad/followers","following_url":"https://api.github.com/users/hassandad/following{/other_user}","gists_url":"https://api.github.com/users/hassandad/gists{/gist_id}","starred_url":"https://api.github.com/users/hassandad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hassandad/subscriptions","organizations_url":"https://api.github.com/users/hassandad/orgs","repos_url":"https://api.github.com/users/hassandad/repos","events_url":"https://api.github.com/users/hassandad/events{/privacy}","received_events_url":"https://api.github.com/users/hassandad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-13T12:01:39Z","updated_at":"2015-12-02T13:06:25Z","closed_at":"2015-12-02T13:06:25Z","body":"Hi Yajra,\r\n\r\nI am having an issue while implementing data tables. I am running your demo app on my local machine and it works perfect. However i am implementing very simple server side example. But i am having issue when DATA key of json returned from server does not contain results in key value pair thats why i am unable to access colums using their index name rather than i am able to access them using index number like 0,1,2. I am doing this\r\n\r\n$vessel = Vessel::select(['id','Name','RegistrationNo','created_at','updated_at']);\r\nreturn Datatables::of($vessel)->make();\r\n\r\nand here i copies piece of json result data index... \r\n\"data\":[[1,\"Lorem ipsum\",\"REG-1\",\"2015-07-10 07:28:43\"\r\n,\"2015-08-03 12:12:10\"],[2,\"Large Boat\",\"REG-2\",\"2015-07-10 07:28:43\",\"2015-07-10 07:28:43\"]\r\n\r\nMy JS Code:\r\n\r\n$(function() {\r\n        $('#vessel-table').DataTable({\r\n            processing: true,\r\n            serverSide: true,\r\n            ajax: '{!! route('vessel.data') !!}',\r\n            columns: [\r\n                {data: '0', name: 'id'},\r\n                {data: '1', name: 'Name'},\r\n                {data: '2', name: 'RegistrationNo'},\r\n                {data: '3', name: 'created_at'},\r\n                {data: '4', name: 'updated_at'},\r\n            ]\r\n        });\r\n    });\r\n</script>\r\n\r\nYou can see i am unable to access them using their key name becuase data is not comming in key value pair.  Json in your demo send key value pair data but why not in my case. may be its related to laravel  but i am not sure please help me.."}}