title: Laravel 4 and Bootstrap Switch
body: <p>I am trying to use the Bootstrap Switch (<a href="http://www.bootstrap-switch.org" rel="nofollow">http://www.bootstrap-switch.org</a>) with the latest version of Laravel (4.2.8) however I am new to learning this framework and PHP.  </p>
  
  <p>I have referenced the four required files within the head of my main index.blade.php file as shown below:</p>
  
  <pre><code>{{ HTML::style('public/bootstrap-switch-style/css/bootstrap-switch.css') }}
  {{ HTML::style('public/bootstrap-switch-master/css/bootstrap.css') }}
  {{ HTML::script('public/bootstrap-switch-master/js/jquery.js') }}
  {{ HTML::script('public/bootstrap-switch-master/js/bootstrap-switch.js') }}
  </code></pre>
  
  <p>Further down the index.blade.php file I create a checkbox with a value of checked, and attempt to call the function to concert the checkbox to a toggle switch.</p>
  
  <pre><code>&lt;input type="checkbox" name="my-checkbox" checked&gt;
  {{$toggle=("[name='my-checkbox']").bootstrapSwitch();}}
  </code></pre>
  
  <p>The following error appears:</p>
  
  <p>Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR) 
  Call to undefined function bootstrapSwitch()</p>
  
  <p>Underneath that error an extract of my index.blade.php file is referenced:</p>
  
  <pre><code>&lt;input type="checkbox" name="my-checkbox" checked&gt;
  &lt;?php echo $toggle=("[name='my-checkbox']").bootstrapSwitch();; ?&gt;
  </code></pre>
  
  <p>Has anyone managed to integrate the Bootstrap Switch with Laravel previously, or is there any other way of doing this?  Ultimately this is for a staff availability website which which should toggle red for if someone is unavailable, or green for if they are available.  The status (boolean) is stored with a MySQL database.  Many thanks in advance.</p>