title: Laravel Eloquent model id as string return wrong value in
body: <p>There is OauthClient model which $client->id does not return correct value in Laravel 5.2. </p>
  
  <p>"lucadegasperi/oauth2-server-laravel": "^5.1" is used that has in migration
  $table->string('id', 40)->primary();</p>
  
  <p>However when use $client->id in blade template then I get back "0" . Using dd($client) show correct value in id attribute.</p>
  
  <p>What could be wrong?</p>
  
  <p>Model output from dd()</p>
  
  <pre><code>OauthClient {#254 ▼
    #connection: null
    #table: null
    #primaryKey: "id"
    #keyType: "int"
    #perPage: 15
    +incrementing: true
    +timestamps: true
    #attributes: array:7 [▼
      "id" =&gt; "wISw4JmlMQCCrMupjojcuDTK3k4hwtkb"
      "secret" =&gt; "nnw3CPTzeQSIfT4KpR0d3XzWIKKoghB3"
      "name" =&gt; "http://example.com"
      "package" =&gt; "free"
      "user_id" =&gt; 2
      "created_at" =&gt; "2016-07-19 15:36:28"
      "updated_at" =&gt; "2016-07-19 15:36:28"
    ]
    #original: array:7 [▶]
    #relations: []
    #hidden: []
    #visible: []
    #appends: []
    #fillable: []
    #guarded: array:1 [▼
      0 =&gt; "*"
    ]
    #dates: []
    #dateFormat: null
    #casts: []
    #touches: []
    #observables: []
    #with: []
    #morphClass: null
    +exists: true
    +wasRecentlyCreated: false
  }
  </code></pre>
  
  <p>Table structure from "show create table oauth_clients"</p>
  
  <pre><code>CREATE TABLE `oauth_clients` (
    `id` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
    `secret` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
    `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `package` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
    `user_id` int(10) unsigned NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `oauth_clients_id_secret_unique` (`id`,`secret`),
    KEY `oauth_clients_user_id_foreign` (`user_id`),
    CONSTRAINT `oauth_clients_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
  </code></pre>