title: Laravel Eloquent Fetch the logs that only belong to users who are belongs to shop
body: <p>I have a 3 Models like this</p>
  
  <p>users</p>
  
  <blockquote>
    <p>belongs to shop</p>
  </blockquote>
  
  <p>logs</p>
  
  <blockquote>
    <p>belongs to user</p>
  </blockquote>
  
  <p>shop</p>
  
  <p>now I need to fetch only the logs of the users that are only belong to shop</p>
  
  <p>Here's my query but incomplete</p>
  
  <pre><code>Logs::whereHas('users', function($q) use ($shop_id) {
   $q-&gt;shop()-&gt;where('shop.id', $shop_id);
  })-&gt;get();
  </code></pre>
  
  <p>But doesn't succeed.</p>
  
  <p>Thanks guys</p>