title: Using UUID as primary key on users table causes PDOEXCEPTION error
body: <p>Uuids.php - Generate a uuid for the user id</p>
  
  <pre><code>&lt;?php
  
  namespace App\Traits;
  
  use Ramsey\Uuid\Uuid;
  
  use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
  
  trait Uuids
  {
  
      // Boot function from laravel.
      protected static function boot()
      {
          parent::boot();
  
          static::creating(function ($model) {
              $model-&gt;{$model-&gt;getKeyName()} = Uuid::uuid1()-&gt;toString();
          });
      }
  
  }
  </code></pre>
  
  <p>-</p>
  
  <p>User Schema</p>
  
  <pre><code>Schema::create('users', function (Blueprint $table) {
          // $table-&gt;increments('id');
          $table-&gt;uuid('id');
          $table-&gt;primary('id');
      });
  </code></pre>
  
  <p>-</p>
  
  <p>Post Schema</p>
  
  <pre><code>Schema::create('posts', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;integer('user_id')-&gt;unsigned();
          $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users');
      });
  </code></pre>
  
  <p>User's Model</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Uuids;
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      use Notifiable;
  
      public $incrementing = false;
  
  }
  </code></pre>
  
  <p>Errors I'm getting when I run php artisan migrate</p>
  
  <p>: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table <code>posts</code> add constraint <code>posts_user_id_foreign</code> foreign key (<code>user_id</code>) references <code>users</code> (<code>id</code>))</p>
  
  <p>PDOException::("SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint")</p>
  
  <p>PDOStatement::execute()</p>