title: Laravel create dynamic attribute when doing write in Model
body: <p>I wonder if it is possible to create or set an attribute when writing in the Model. I tried to do it with a setMutator, but when the attribute is not provided in the list with arguments for a save the value is not created</p>
  
  <pre><code>public function setExampleAttribute($value)
  {
      $this-&gt;attributes['example'] = 100;
  }
  </code></pre>
  
  <p>So when I do this:</p>
  
  <pre><code>Version::create(['name' =&gt; 'mark', 'example' =&gt; '50');
  </code></pre>
  
  <p>The record is saved with 100.</p>
  
  <p>But when I do this:</p>
  
  <pre><code>Version::create(['name' =&gt; 'mark');
  </code></pre>
  
  <p>The record is empty. </p>
  
  <p>Is there a way to do something in between? So before the object is written, add some dynamic content?</p>