I would like to return integers als integers from my database. At the moment all values would be loaded as Strings. Database is MSSQL 2012 and ill use the PDO driver (for v5.6).
Trying to set the properties here: (as shown here, but i dont know if thats still possible: http://fideloper.com/laravel-pdo-connection-options)
'sqlsrv' => [
'driver' => 'sqlsrv',
'charset' => 'utf8',
'prefix' => '',
'options' => array(
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_EMULATE_PREPARES => false,
SQLSTATE[IMSSP]: The given attribute is only supported on the PDOStatement object.
$pdo = DB::connection()->getPdo();
.. do ORM Query
I believe this issue is related to the PDO driver used (thats installed with PHP, not laravel configuration).
Not quite what you're looking for but could potentially solve your problems. Since laravel 5 theres been a casts feature on eloquent where your columns are automatically cast to your pre-defined types. See http://laravel.com/docs/5.0/eloquent#attribute-casting
// Eloquent Model protected $casts = [ 'int_column' => 'int', ];
int_column would then automatically be cast to an int when the model is retrieved from the database