{"action":"created","issue":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1702","repository_url":"https://api.github.com/repos/yajra/laravel-datatables","labels_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1702/labels{/name}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1702/comments","events_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1702/events","html_url":"https://github.com/yajra/laravel-datatables/pull/1702","id":313252258,"number":1702,"title":"Support for Eloquent API Resources","user":{"login":"asahasrabuddhe","id":25657923,"avatar_url":"https://avatars0.githubusercontent.com/u/25657923?v=4","gravatar_id":"","url":"https://api.github.com/users/asahasrabuddhe","html_url":"https://github.com/asahasrabuddhe","followers_url":"https://api.github.com/users/asahasrabuddhe/followers","following_url":"https://api.github.com/users/asahasrabuddhe/following{/other_user}","gists_url":"https://api.github.com/users/asahasrabuddhe/gists{/gist_id}","starred_url":"https://api.github.com/users/asahasrabuddhe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asahasrabuddhe/subscriptions","organizations_url":"https://api.github.com/users/asahasrabuddhe/orgs","repos_url":"https://api.github.com/users/asahasrabuddhe/repos","events_url":"https://api.github.com/users/asahasrabuddhe/events{/privacy}","received_events_url":"https://api.github.com/users/asahasrabuddhe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-04-11T09:53:29Z","updated_at":"2018-04-17T07:00:28Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/yajra/laravel-datatables/pulls/1702","html_url":"https://github.com/yajra/laravel-datatables/pull/1702","diff_url":"https://github.com/yajra/laravel-datatables/pull/1702.diff","patch_url":"https://github.com/yajra/laravel-datatables/pull/1702.patch"},"body":"Hello,\r\n\r\nThis PR aims to address the following issues:\r\n\r\nhttps://github.com/yajra/laravel-datatables/issues/1515\r\nhttps://github.com/yajra/laravel-datatables/issues/1659\r\n\r\nLaravel 5.5 introduced to us Eloquent API resources where we could easily describe the format that we wanted for our API responses. This package currently does not support the new API resources. Through this PR, I have added a new engine to handle API Resources, updated the configuration and added a new test case to test the new functionality.\r\n\r\nWe can use the package as below now:\r\n\r\n`DataTables::of(App\\Http\\Resources\\UserResource::collection(App\\User::all()))->toJson();`\r\n\r\nor\r\n\r\n`datatables()->of(App\\Http\\Resources\\UserResource::collection(App\\User::all()))->toJson();`\r\n\r\nor\r\n\r\n`DataTables::resource(App\\Http\\Resources\\UserResource::collection(App\\User::all()))->toJson();`\r\n\r\nor \r\n\r\n`datatables->resource(App\\Http\\Resources\\UserResource::collection(App\\User::all()))->toJson();`\r\n\r\n\r\nPlease review and let me know if there are any corrections and/or enhancements that can be done here if this PR is considered to be merged.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/comments/381870508","html_url":"https://github.com/yajra/laravel-datatables/pull/1702#issuecomment-381870508","issue_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/1702","id":381870508,"user":{"login":"yajra","id":2687997,"avatar_url":"https://avatars3.githubusercontent.com/u/2687997?v=4","gravatar_id":"","url":"https://api.github.com/users/yajra","html_url":"https://github.com/yajra","followers_url":"https://api.github.com/users/yajra/followers","following_url":"https://api.github.com/users/yajra/following{/other_user}","gists_url":"https://api.github.com/users/yajra/gists{/gist_id}","starred_url":"https://api.github.com/users/yajra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yajra/subscriptions","organizations_url":"https://api.github.com/users/yajra/orgs","repos_url":"https://api.github.com/users/yajra/repos","events_url":"https://api.github.com/users/yajra/events{/privacy}","received_events_url":"https://api.github.com/users/yajra/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T07:00:28Z","updated_at":"2018-04-17T07:00:28Z","author_association":"OWNER","body":"I just made a quick test and it seems like dataTables pagination is not working properly when using paginated resource. Will test further later."}}
{"actor":{"display_login":"yajra"}}