title: Laravel "many to many" query the relation with "where"
body: <p>look at the code first: </p>
  
  <pre><code>&lt;?php
  
  class User extends Eloquent {
  
      public function books() 
      {
          return $this-&gt;belongsToMany('Book');
      }
  }
  
  class Book extends Eloquent {
  
      public function users() 
      {
          return $this-&gt;belongsToMany('User');
      }
  }
  </code></pre>
  
  <p>I want to find some User with a id '1',and get the book name where is equal to something ,like this </p>
  
  <pre><code>  User::with(array('Book' =&gt; function($query) 
    {
        $query-&gt;where('bookname','www')-&gt;get();
    }));
  </code></pre>
  
  <p>but it return a user information and the empty array ,
      Users: {
        name: 'xxx',
        xxx: 'xxx',
        books: []
       };</p>
  
  <p>who can help me to fix this issue?  thank you so much !</p>