title: Querying join tables with Eloquent in Laravel
body: <p>Im using Laravel Eloquent to make a join query.
  Here are my Models</p>
  
  <p><strong>My Queue Schema:</strong></p>
  
  <pre><code>    $table-&gt;increments('id');
  
      $table-&gt;string('task');
  
      $table-&gt;string('qustatus');
  
      $table-&gt;boolean('inqueue');
  
      $table-&gt;integer('user_id')-&gt;index();
  
      $table-&gt;timestamps();
  </code></pre>
  
  <p><strong>Queue Model</strong></p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Queue extends Model
  {
      public function user()
      {
          return $this-&gt;belongsTo('App\User');
      }
  }
  </code></pre>
  
  <p><strong>my User Schema:</strong></p>
  
  <pre><code>$table-&gt;increments('id');
              $table-&gt;string('name');
              $table-&gt;string('email')-&gt;unique();
              $table-&gt;string('password');
              $table-&gt;rememberToken();
              $table-&gt;timestamps();
              $table-&gt;string('fcmToken')-&gt;nullable();
  </code></pre>
  
  <p><strong>User Model:</strong></p>
  
  <pre><code>class User extends Authenticatable
  {
      public function queues()
      {
          return $this-&gt;hasMany('App\Queue');
      }
  }
  </code></pre>
  
  <p>here i'm trying to get the <code>fcmToken</code> for all the users with <code>inqueue</code> set to <code>1</code>or <code>true</code>
  I have tried to use '$queue = Queue::with('user')->get();' which returns the entire data. but failed to filter it or find any article with similar sample. </p>