title: Octobercms: clear $attachOne relationship
body: <p>I have a problem updating an <em>attachOne</em> relation of a model from a frontend form under <strong>Octobercms</strong>.</p>
  
  <p>I have a "<em>Customer</em>" model and relative controller with a field in the backend form where I, as admin, can edit its company logo.</p>
  
  <p>I also have built (with <strong>Foundation</strong>) a frontend form that the logged in customer can edit, changing his logo accordingly.</p>
  
  <p>I setup a <em>placeholder</em> in my </p>
  
  <pre><code>/themes/mytheme/dist/assets/img/placeholder.png 
  </code></pre>
  
  <p>and I show it when the user hasn't uploaded his file yet.</p>
  
  <p>I can then upload a pic and change the logo correctly and I set the</p>
  
  <pre><code>$model-&gt;company_logo 
  </code></pre>
  
  <p>with no issues.</p>
  
  <p>The problem is when the user resets the form and submits a <strong>null</strong> field value: I'm not able to empty the $model->company_logo relation.</p>
  
  <p>I tried with <em>unset()</em>, passing <em>null</em> values, <em>empty strings</em> and so on but with no luck.</p>
  
  <p>Any ideas?</p>
  
  <p>Thank you in advance.</p>