title: How can I update a polymorphic many-to-many pivot record (using the exact pivot id) in laravel?
body: <p>I want to access my polymorphic (many-to-many) relation in pivot level. Lets say I have:</p>
  
  <pre><code>- pages
    id - title
  - articles
    id - title - body
  - quotes
    id - title - body
  - pageables
    id - order - pageable_type - pageable_id - page_id
  </code></pre>
  
  <p>Now as you can see I have pages that can have articles and quotes. So that I can call a page and its contents (articles and quotes) in an order. For example:</p>
  
  <pre><code>  page1
       article1
       quote3
    page2
       article2
       quote1
    page3
       article1
       quote1
       article1
  </code></pre>
  
  <p>Note that 'page3' has two 'article1'. A page can have multiple <strong>same</strong> articles or quotes. Actually that's why I need to update the <strong>exact</strong> pivot using it's <strong>exact</strong> row id. Yes I could use the sync() method but it would delete all duplicate records. Even if I would use syncWithoutDetaching() I wouldn't be able to update the exact pivot I want. On the other hand I tried the  updateExistingPivot() method but it doesn't update (the exact) pivot as well. For example: </p>
  
  <pre><code>\App\Article::find(1)-&gt;pages()-&gt;updateExistingPivot(3, ['page_id'=&gt;1]);
  </code></pre>
  
  <p>Here the first parameter is assumed t o be the id of the page and not the id of the pivot row itself (normally the pivot table hasn't a id at all).</p>
  
  <p>Is there any laravelish way to do that? (except using fluent query builder or not accepting duplicate records at the first place :) )</p>