title: Laravel/Scrutinizer: The property username does not seem to exist on App\User. Are you sure there is no database migration missing?
body: <p>I have this issue from several days in Scrutinizer CI.</p>
  
  <p>I would get ride of it, but don't know how to do. This is the migration script:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>public function up()
  {
      Schema::create('users', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('username')-&gt;unique();
          $table-&gt;string('password');
          $table-&gt;rememberToken();
          $table-&gt;datetime('last_change_password')-&gt;nullable();
          $table-&gt;timestamps();
      });
  }
  </code></pre>
  
  <p>And this is my <code>App\User</code></p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  use Validator;
  
  class User extends Authenticatable
  {
      use Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'username', 'password',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  
      /**
       * @param int $id the id of the user
       * @param array $data
       *
       * @return mixed
       */
      public function changePassword(int $id, array $data)
      {
          $rules = [
              'username' =&gt; 'sometimes|required|string|min:8|unique:users,username,'.$id,
              'new_password' =&gt; 'required|string|confirmed|min:8'
          ];
  
          $validator = Validator::make($data, $rules);
  
          if ($validator-&gt;fails()) {
              return $validator-&gt;errors()-&gt;all();
          } else {
              $object = $this-&gt;find($id);
              if (is_object($object)) {
                  if (isset($data[ 'username' ])) {
                      $object-&gt;username = $data[ 'username' ];
                  }
                  $object-&gt;password = bcrypt($data[ 'new_password' ]);
                  $object-&gt;last_change_password = \Carbon\Carbon::now();
                  $status = $object-&gt;save();
              } else {
                  $status = false;
              }
  
              return $status;
          }
      }
  
      /**
       *
       * @param array $data the data to update
       * @return bool
       */
      public function updateRecord(array $data)
      {
          $rules = [
              'username' =&gt; 'sometimes|required|string|min:8|unique:users,username,'.$data[ 'id' ],
              'password' =&gt; 'required|string|min:8'
          ];
  
          $validator = Validator::make($data, $rules);
  
          if ($validator-&gt;fails()) {
              return $validator-&gt;errors()-&gt;all();
          } else {
              $id = $data[ 'id' ];
              $object = $this-&gt;find($id);
  
              if (is_object($object)) {
                  foreach ($data as $key =&gt; $value) {
                      if (in_array($key, $this-&gt;fillable)) {
                          $object-&gt;$key = $value;
                      }
                  }
                  $status = $object-&gt;save();
              } else {
                  $status = false;
              }
              return $status;
          }
      }
  }
  </code></pre>