title: How to store a checkbox as being checked in database
body: <p>So I have three blades indes, add and edit.
  In my database table i have a schema like:
  Schema::create('categories', function($table)</p>
  
  <pre><code>    {
          $table-&gt;increments('id');
          $table-&gt;string('status')-&gt;nullable();
          $table-&gt;integer('category');
      });
  </code></pre>
  
  <p>In my add blade I have tried something like:</p>
  
  <pre><code>                            &lt;div class="form-group"&gt;
                                  &lt;script&gt;
                                      init.push(function () {
                                          $('#categories-status').switcher({
                                              theme: 'checkbox',
                                              on_state_content: '&lt;span class="fa fa-check"&gt;&lt;/span&gt;',
                                              off_state_content: '&lt;span class="fa fa-times"&gt;&lt;/span&gt;'
                                          });
                                      });
                                  &lt;/script&gt;
                                  &lt;label for="category"&gt;Speciality&lt;/label&gt;
                                  &lt;input type="checkbox" name="status" id="categories-status" id="categories-status" value=""&gt;
                              &lt;/div&gt;
  </code></pre>
  
  <p>And in my controller I have a function "postSave" in which I use</p>
  
  <pre><code> $category-&gt;status = ($request-&gt;input('status') == 'on') ? 1 : 0;
  </code></pre>
  
  <p>to store the status.
  Yet I do not get the results I want, it doesn't save as being checked.
  In my index blade I display the checkbox in a table like this:</p>
  
  <pre><code>&lt;td&gt;{{ ($category-&gt;status == 1) ? 'Active' : 'Inactive' }}&lt;/td&gt;
  </code></pre>