title: Best practice for storing checkbox and textarea in Laravel
body: <p>I have already seen a few different approaches for storing
  textarea and checkbox and then showing them on edit view and show view...
  but I am still not satisfied and would like to hear from You, how do you handle the unchecked checkbox and
  especially the textarea security on show and edit with some wysiwyg plugin like ckeditor or tinymce?</p>
  
  <p>For example for checkboxes I am using this setter;</p>
  
  <pre><code>public function setActiveAttribute($value): void
  {
      $this-&gt;attributes['active'] = $value ? 1 : 0;
  }
  </code></pre>
  
  <p>Is this the best way to do it? </p>
  
  <p>And for textarea on submit I allow everything and then on <code>edit view</code> I show it like this:</p>
  
  <pre><code>{!! Form::textarea($key, htmlentities($value), ['class' =&gt; 'form-control ckeditor-field']) !!}
  </code></pre>
  
  <p>and on <code>show view</code> I'm using a Purifier (link below) and I show it like this</p>
  
  <pre><code>{!! \Purifier::clean($value) !!}
  </code></pre>
  
  <p>So I just wanted to know what are the best practices? Is this fine what I'm doing?</p>
  
  <p><a href="https://github.com/mewebstudio/Purifier" rel="nofollow noreferrer">https://github.com/mewebstudio/Purifier</a></p>