title: Object of class Illuminate\Database\Eloquent\Builder could not be converted to string in laravel 5.1
body: <p>I have been trying to debug a problem for the past two days, my code, as follows, is first attempting to retrieve the category by it's id:</p>
  <pre><code>$term = category::get(['id']);
  </code></pre>
  <p>Then using this retrieved term for querying models with a foreign key on that category:</p>
  <pre><code>$categories = HelpCenter::whereHas('category', function($category) use ($term)
  {
      $category-&gt;where('category_id','=',$category);
  })
    -&gt;take(5)-&gt;get();
  </code></pre>
  <p>Unfortunately my code throws the error <code>Object of class Illuminate\Database\Eloquent\Builder could not be converted to string</code></p>