title: Database not storing checkbox data
body: <p>so I have an input form which contains a few checkboxes, and for some reason my database does not want to store data depending on whether they are pressed.</p>
  
  <p>My code</p>
  
  <p>Index:</p>
  
  <pre><code>&lt;table&gt;
      &lt;form action="/htirs" method="POST"&gt;
          &lt;tr&gt;
              &lt;td&gt;Rengjort Oppløsningsfilter&lt;/td&gt;&lt;td&gt;&lt;input type="checkbox" name="renOpFilt" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Ren Nal&lt;/td&gt;&lt;td&gt;&lt;input type="checkbox" name="renNal" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;kontrSlangTank&lt;/td&gt;&lt;td&gt;&lt;input type="checkbox" name="kontrSlangTank" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;kontrSlangTank&lt;/td&gt;&lt;td&gt;&lt;input type="checkbox" name="kontrSlangTank" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;?php //Output for om lagringen gikk bra eller ikke.
                  if(isset($test3))
                  {
                      if($test3)
                      {
                          echo "Lagret i databasen!";
                      }
                      else
                      {
                          echo "Feil! Data ikke lagret!";
                      }
                  }
                  else
                  {
                      echo "&lt;hr/&gt;";
                  } ?&gt;
              &lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="lagre3" value="Lagre" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/form&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Routes:</p>
  
  <pre><code>Route::post('/htirs', 'HomeController@insertHTirs');
  </code></pre>
  
  <p>HomeController:</p>
  
  <pre><code>public function insertHTirs()
      {
          $now = new DateTime();
          $now-&gt;setTimezone(new DateTimeZone('Europe/Oslo'));
  
          $input = Input::all();
  
          if(Input::get('renOpFilt') == 'on')
          {
              $renOpFilt = 1;
          }
          else
          {
              $renOpFilt = 0;
          }
  
          if(Input::get('renNal') == 'on')
          {
              $renNal = 1;
          }
          else
          {
              $renNal = 0;
          }
  
          if(Input::get('kontrSlangTank') == 'on')
          {
              $kontrSlangTank = 1;
          }
          else
          {
              $kontrSlangTank = 0;
          }
  
          if(Input::get('kontrOgRenPad') == 'on')
          {
              $kontrOgRenPad = 1;
          }
          else
          {
              $kontrOgRenPad = 0;
          }
  
  
          try {
              DB::beginTransaction();
              $query = DB::table('hvertirsdag')-&gt;insert(array(
                  'dato' =&gt; $now-&gt;format('d.m.Y'),
                  'tid' =&gt; $now-&gt;format('H:i'),
                  'renOpplFilter' =&gt; $renOpFilt,
                  'renNal' =&gt; $renNal,
                  'kontrSlangTank' =&gt; $kontrSlangTank,
                  'kontrOgRenPad' =&gt; $kontrOgRenPad));
  
              $query2 = DB::table('ansatt_htirs')-&gt;insert(array(
                  'ansattId' =&gt; '1',
                  'dato' =&gt; $now-&gt;format('d.m.Y'),
                  'tid' =&gt; $now-&gt;format('H:i')));
                  DB::commit();
  
                  if($query &amp;&amp; $query2)
                  {
                      $test3 = true;
                      return View::make('index')-&gt;with('test3', $test3);
                  }
  
              }
          catch (\PDOException $e)
              {
                  DB::rollback();
                  $test3 = false;
                  return View::make('index')-&gt;with('test3', $test3);
              }
      }
  </code></pre>
  
  <p>The only return I get is that it failed to store the data in the database, whereas I can return the variables to the view and echo them out without problems, and I cannot for the life of me figure out where this goes wrong. Thanks for your time.</p>