title: Laravel Soft Delete Unique column name
body: <p>Suppose I have category table and I have used soft delete on it. Now first time I have added one category "Test" after that I have delete this category so it will update my <code>deleted_at</code> column from the database.</p>
  
  <p>Now when again I am trying to add category with name "Test" it is saying me that this name has been taken. I have tried with rules which are posted <a href="https://stackoverflow.com/questions/17458681/laravel-4-how-to-use-a-unique-validation-rule-unique-columns-with-soft-delet">Here</a>.</p>
  
  <p>But it is not working. I have used trait in my model. Below is my model code.</p>
  
  <pre><code>&lt;?php
  namespace App\Models;
  
  use Illuminate\Support\Facades\Validator as Validator;
  use Illuminate\Database\Eloquent\SoftDeletingTrait;
  
  class Category extends \Eloquent {
  
      use SoftDeletingTrait;
  
      protected $dates = ['deleted_at'];
  
      /**
       * Guarded fields which are not mass fillable
       *
       * @var array
       */
      protected $guarded = array('id');
  
      /**
       * Name of the table used
       *
       * @var string
       */
      protected $table = 'travel_categories';
  
      /**
       * Validating input.
       *
       * @param array $input
       * @return mixed (boolean | array)
       */
      public static function validate($input, $id = null) {
          $rules = array(
              'name' =&gt; array('required','min:2','max:100','regex:/[a-zA-z ]/','unique:travel_categories,name,NULL,id,deleted_at,NULL'),
              'description' =&gt; 'Required|Min:2',
              'image' =&gt; 'image'
          );
          if ($id) {
              $rules['name'] = 'Required|Between:3,64|Unique:travel_categories,name,'.$id;
          }
  
          $validation = Validator::make($input,$rules);
  
          return ($validation-&gt;passes())?true : $validation-&gt;messages();
      }
  }
  </code></pre>