laravel/framework — pull request #1647 by jeremyaarts (2013-06-14 13:56:03+00:00)
Title: Fix to object conversion on after sortBy

After sortBy is called on a collection it is no longer an array but an object when the collection is outputted with toJson(). This makes sure it is still sorted, but it remains an array.

Before sortBy:
```javascript
[
{
"id":2,
"username":"user2"
},
{
"id":3,
"username":"user3"
}
]
```

After sortyBy, toJson outputs:
```javascript
{
"1":{
"id":2,
"username":"user2"
},
"0":{
"id":3,
"username":"user3"
}
}
```
With this change:
```javascript
[
{
"id":3,
"username":"user3"
},
{
"id":2,
"username":"user2"
}
]
```