title: Laravel Eloquent Attribute Casting not work
body: <p>I have a Laravel Models that return string value instead of integer in my staging server.
  I decided to <a href="https://laravel.com/docs/5.3/eloquent-mutators#attribute-casting" rel="noreferrer">cast</a> attribute's values to get always the integer value.</p>
  
  <p>I report my Model:</p>
  
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  class PressReviewPreset extends Model
  {
      /**
       *  Use soft delete
       */
      use SoftDeletes;
  
      /**
       * The database table used by the model.
       *
       * @var string
       */
      protected $table = 'pr_preset';
  
      /**
       * The attributes that should be mutated to dates.
       *
       * @var array
      */
      protected $dates = ['deleted_at'];
  
      /**
       * The attributes that should be casted to native types.
       *
       * @var array
      */
      protected $casts = [
          'id' =&gt; 'integer',
          'user_id' =&gt; 'integer',
          'is_default' =&gt; 'integer',
      ];
  
      /**
       * The database field "updated_at" of table with a custom name
       * @var string
       */
      const UPDATED_AT = 'last_update';
  
      /*
      |---------------------------|
      |   Aliases for attribute   |
      |---------------------------|
      */
  
      // Id
      public function getIdAttribute()
      {
          return $this-&gt;attributes['id'];
      }
      public function setIdAttribute($id)
      {
          $this-&gt;attributes['id'] = $id;
      }
  
      // UserId
      public function getUserIdAttribute()
      {
          return $this-&gt;attributes['user_id'];
      }
      public function setUserIdAttribute($user_id)
      {
          $this-&gt;attributes['user_id'] = $user_id;
      }
  
      // Default
      public function getDefaultAttribute()
      {
          return $this-&gt;attributes['is_default'];
      }
      public function setDefaultAttribute($is_default)
      {
          $this-&gt;attributes['is_default'] = $is_default;
      }
  
      // ...
  
  }
  </code></pre>
  
  <p>When I call attributes in my macbook's artisan tinker I get this results:</p>
  
  <pre><code>&gt;&gt;&gt; $p = App\Models\PressReviewPreset::first()
  =&gt; App\Models\PressReviewPreset {#810
       id: 41,
       user_id: 391,
       name: "DEMO",
       is_default: 1,
       last_update: "2017-03-10 14:32:39",
       created_at: "2017-03-10 14:27:24",
       deleted_at: null,
     }
  &gt;&gt;&gt; $p-&gt;id
  =&gt; 41
  &gt;&gt;&gt; $p-&gt;user_id
  =&gt; 391
  &gt;&gt;&gt; $p-&gt;userId
  =&gt; 391
  &gt;&gt;&gt; $p-&gt;is_default
  =&gt; 1
  &gt;&gt;&gt; $p-&gt;default
  =&gt; 1
  </code></pre>
  
  <p>All values are correctly integer.</p>
  
  <p>But if I call same attributes on my staging server I get this results:</p>
  
  <pre><code>&gt;&gt;&gt; $p = App\Models\PressReviewPreset::first()
  =&gt; App\Models\PressReviewPreset {#810
       id: "41",
       user_id: "391",
       name: "DEMO",
       is_default: "1",
       last_update: "2017-03-10 14:32:39",
       created_at: "2017-03-10 14:27:24",
       deleted_at: null,
     }
  &gt;&gt;&gt; $p-&gt;id
  =&gt; "41"
  &gt;&gt;&gt; $p-&gt;user_id
  =&gt; "391"
  &gt;&gt;&gt; $p-&gt;userId
  =&gt; "391"
  &gt;&gt;&gt; $p-&gt;is_default
  =&gt; 1
  &gt;&gt;&gt; $p-&gt;default
  =&gt; "1"
  </code></pre>
  
  <p>Why <code>user_id</code> is not correctly casted to integer?</p>
  
  <p>Am I doing somethings wrong?</p>
  
  <p>Thanks in advance!</p>