title: Laravel: Use the method updateOrCreate on polymorphic relation
body: <p>I am trying to use the method updateOrCreate on my polymorphic relation, which is called Taggable. This is the method I use to create a new tag.</p>
  
  <pre><code>public function attachTag($attributes)
      {
          return $this-&gt;tags()-&gt;create($attributes);
      }
  </code></pre>
  
  <p>If I change the create method to the update, it also works fine when it comes to updating the model. But I want to use updateOrCreate method, which is problem because I don't pass the ID in the $attributes and therefore it just doesn't know, if there's some record in the DB or not.</p>
  
  <p>I made some googling and found very little about this particular case, only something like I should pass second parameter. But I'm confused which parameter should I pass as second to make it working.</p>
  
  <p>Thanks in advance for any help.</p>