{"action":"closed","issue":{"url":"https://api.github.com/repos/yajra/laravel-datatables/issues/75","labels_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/75/comments","events_url":"https://api.github.com/repos/yajra/laravel-datatables/issues/75/events","html_url":"https://github.com/yajra/laravel-datatables/issues/75","id":88354510,"number":75,"title":"Sorting Issue in Collection Laravel 5.1","user":{"login":"ashutoshjha88","id":12884776,"avatar_url":"https://avatars.githubusercontent.com/u/12884776?v=3","gravatar_id":"","url":"https://api.github.com/users/ashutoshjha88","html_url":"https://github.com/ashutoshjha88","followers_url":"https://api.github.com/users/ashutoshjha88/followers","following_url":"https://api.github.com/users/ashutoshjha88/following{/other_user}","gists_url":"https://api.github.com/users/ashutoshjha88/gists{/gist_id}","starred_url":"https://api.github.com/users/ashutoshjha88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashutoshjha88/subscriptions","organizations_url":"https://api.github.com/users/ashutoshjha88/orgs","repos_url":"https://api.github.com/users/ashutoshjha88/repos","events_url":"https://api.github.com/users/ashutoshjha88/events{/privacy}","received_events_url":"https://api.github.com/users/ashutoshjha88/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-15T08:17:54Z","updated_at":"2015-06-16T00:49:09Z","closed_at":"2015-06-16T00:49:09Z","body":"It seems sorting is not working for collection in laravel5.1\r\n\r\nIn CollectionEngine.php Line No.231 and Line No. 235 if we add `$this->collection =` then sorting will work.\r\n \r\n```php\r\n if ( ! empty($column['name'])) {\r\n                    $this->collection = $this->collection->sortBy(function ($row) use ($column) {\r\n                        return $row[$column['name']];\r\n                    });\r\n                } elseif (isset($columns[$order_col])) {\r\n                    $this->collection = $this->collection->sortBy(function ($row) use ($columns, $order_col) {\r\n                        return $row[$columns[$order_col]];\r\n                    });\r\n                }\r\n````\r\n"}}