I have a checkbox on my Laravel 5.1 form that I have incorporated the Bootstrap Toggle attributes to. The problem is, when the form is submitted, the checkbox doesn't get sent with the request. I have verified that it is selected (checked = checked). I have another checkbox on the same form that isn't using the Bootstrap Toggle styling and it passes as expected.
Here is the form input:
{!! Form::checkbox('status', '1', $employee->status, array('data-toggle' => 'toggle')) !!}
($employee->status is a boolean)
Here are all of the scripts and css I'm loading in my project:
<!-- Stylesheets -->
<link href="/css/app.css" rel="stylesheet">
<link href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" >
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<link href="/css/pams.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/dropzone.css" rel="stylesheet">
@yield('head-css')
<!-- Fonts -->
<link href='//fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>
<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
{{-- Twitter Bootstrap --}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
{{-- This is for the converting a checkbox to a sliding toggle --}}
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
{{-- This is for the autocomplete in the select boxes --}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
{{-- This is for adding photos through drag and drop or click --}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.3.0/dropzone.js"></script>
If I remove "data-toggle" => "toggle" it works as expected.
I tried to reproduce your problem, I created laravel page with form (boostrap, dropzone and this bootstrap toggle included and active):
{!! Form::open(array('url' => 'test')) !!}
{!! Form::checkbox('status', '1', true, array('data-toggle' => 'toggle')) !!}
{!! Form::submit('Send') !!}
{!! Form::close() !!}
And I ran this code on Chrome and Mozilla, the results were: If I have selected the checkbox (on), the status=1 has been added to the form request (the sniffer is Charles)
But if I click once again to make it off, nothing has been added to the form request. And this is normal, you can simple confirm it here
Maybe the problem is in select2 library, but I do not know what are you doing with this. Rest of your code would be really useful to help you.