laravel/settler — pull request #12 by svpernova09 (2014-06-21 02:17:34+00:00)
Title: Swapping php5-mysql to use the Native Driver: php5-mysqlnd

Ran into a problem where data types were not retained when using toArray()

Controller method:

```
public function showWithAllData($id)
{
// Do Response
if (Request::ajax()) {

$jsonResponse = array(
'draft'=>null,
'cards'=>null,
'users'=>null,
'picks'=>null
);

// Get the Draft
$thisDraft = Draft::with('user.avatar')
->with('currentPick')
->find($id);

// Get the Card IDs and user IDs for the Draft
// Create a 'sideloaded' style JSON response
$jsonResponse['draft'] = $thisDraft->toArray();
$jsonResponse['users'] = $thisDraft->user->toArray();
$jsonResponse['cards'] = $this->getCardsForDraft($thisDraft->id)->toArray();
$jsonResponse['picks'] = $this->getPicksForDraft($thisDraft->id)->toArray();

return Response::json($jsonResponse);

} else {

return Redirect::to('/drafts');
}
}
```

Running an ajax call to a route to that controller method will return JSON. The issue is when we check any of the values that should be integers, they're strings. Swapping from php5-mysql to php5-mysqlnd resolves the issue. Here is a stack overflow that may explain the issue better: http://stackoverflow.com/questions/20079320/php-pdo-mysql-returns-integer-columns-as-strings-on-ubuntu-but-as-integers-o