title: How to find all id pivot from pivot table? (laravel 5.3)
body: <p>I have a pivot table. The name is users_banks table. The table have field id, user_id, bank_id, status, account_name and account_number</p>
  
  <p>Now, the pivot have 3 records</p>
  
  <p>I display contain from pivot table using code like this :</p>
  
  <pre><code>$user_id = auth()-&gt;user()-&gt;id;
  $user = $this-&gt;user_repository-&gt;find($user_id);
  
  $account = array();
  foreach($user-&gt;banks as $bank) {
      $account[] = $bank;
  }
  
  dd($account);
  </code></pre>
  
  <p>The result display all record in the form of array. There exist value of field user_id, bank_id, status etc. But I don't find value of id</p>
  
  <p>How can I find id from pivot table?</p>