title: Laravel Eloquent how to create UNIQUE constraint with duplicate NULLs
body: <p>I'm usinq Laravel 5 with MS Sql Server 2014.
  I want to create a unique constraint but it should allow multiple null values.</p>
  
  <p>Here is code I'm using. Where 'passport_no' has to be unique if not null.</p>
  
  <pre><code>Schema::create('UserProfile', function(Blueprint $table){
      $table-&gt;increments('userprofile_id');
      $table-&gt;integer('user_id')-&gt;unsigned();
      $table-&gt;string('passport_no', 50)-&gt;unique()-&gt;nullable();
  
      $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users')
              -&gt;onUpdate('cascade')-&gt;onDelete('cascade');
  });
  </code></pre>