title: Attach method does nothing in observer
body: <p>I have an Observer for a model. When the model is created I want to create and attach another model based on a parameter in the request.</p>
  
  <p>The new model is created successfully. But the relationship is not.</p>
  
  <p>The observer function:</p>
  
  <pre class="lang-php prettyprint-override"><code>public function created(Work $work)
  {
      $new_publisher = request()-&gt;new_publisher;
  
      if($new_publisher) {
          $publisher = Publisher::create([
              'publisher_name' =&gt; $new_publisher,
              'type' =&gt; 2,
              'status' =&gt; false,
          ]);
          $work-&gt;publishers()-&gt;attach($publisher-&gt;id);
      }
  }
  </code></pre>
  
  <p>If I do</p>
  
  <pre class="lang-php prettyprint-override"><code>dd($publisher-&gt;id);
  </code></pre>
  
  <p>before executing the attach command I get the correct id.</p>
  
  <p>Any clue on what's going on over here? I have also tried with:</p>
  
  <pre class="lang-php prettyprint-override"><code>DB::table('publisher_work')-&gt;insert(['publisher_id' =&gt; $publisher-&gt;id,'work_id' =&gt; $work-&gt;id]);
  </code></pre>
  
  <p>but no luck.</p>
  
  <p>Thanks.</p>