title: Can't filter through Relationship in Laravel Datatables
body: <p>so i have a <strong><code>Laravel Datatables</code></strong> project and i'm trying to create a column that, when you click a specific value it will send an <code>AJAX</code> request to the <code>PHP</code> backend and will try to <strong>FILTER</strong> the results on the <code>DataTable</code> by a specific column and that value which you clicked on.</p>
  
  <pre><code>   $sign = Request::input('sign');
  
      return $this-&gt;datatables
          -&gt;eloquent($this-&gt;query())
          -&gt;filter(function ($query) use ($sign) {
              if (request()-&gt;has('sign')) {
                  $query-&gt;where('signs.id', "'$sign'");
              }
          }, true)
          -&gt;addColumn('admin', function($user) {
              return $user-&gt;admin == 1 ? '&lt;span class="fa fa-star"&gt;&lt;/span&gt;' : '&lt;span class="fa fa-star-o"&gt;&lt;/span&gt;';
          })...
  </code></pre>
  
  <p>The problem there is that in the <code>filter</code> method i can't do the Where clause on the related <code>signs</code> table. It's trying to query the <code>signs.id</code> column in the <code>users</code> table, which is not what i want.</p>
  
  <p>On my Model i have the relationship defined like this</p>
  
  <pre><code>public function signs(){
      return $this-&gt;belongsTo('App\Models\Sign', 'sign_id', 'id');
  }
  </code></pre>
  
  <p>And i'm issuing a base query to the Datatable which defined the User model <strong>with signs</strong> like this</p>
  
  <pre><code>public function query()
  {
      $query = User::with('signs');
  
      return $this-&gt;applyScopes($query);
  }
  </code></pre>
  
  <p>What am i doing wrong? Why can't i filter my users through this relationship? Any help will be greatly appreciated as i've already spent hours on it and can't figure it out on my own.</p>