title: laravel eloquent using a scope to compare 2 columns
body: <p>I have 2 date columns in the users table of laravel 5.0. The schema is:</p>
  
  <p>users
    * id
    * email
    * activated_on
    * deactivated_on</p>
  
  <p>I want to query if the user is activated so I have the following scope function:</p>
  
  <pre><code>public function scopeActivated($query){
      $now = date('Y-m-d');
      return $query-&gt;whereBetween('activated_on', ['deactivated_on', $now]);
  }
  </code></pre>
  
  <p>The query that this generates is that it compares the column <code>activated_on</code> to the string <code>deactivated_on</code>.</p>
  
  <p>Is there a way to tell eloquent to compare the 2 columns?</p>