switchfield.blade.php 719 B

123456789101112131415161718192021222324
  1. <div class="{{$viewClass['form-group']}}">
  2. <label for="{{$id}}" class="{{$viewClass['label']}} control-label">{!! $label !!}</label>
  3. <div class="{{$viewClass['field']}}">
  4. @include('admin::form.error')
  5. <input name="{{$name}}" type="hidden" value="0" />
  6. <input type="checkbox" name="{{$name}}" class="{{$class}} la_checkbox" {{ $value == 1 ? 'checked' : '' }} {!! $attributes !!} />
  7. @include('admin::form.help-block')
  8. </div>
  9. </div>
  10. <script require="@switchery">
  11. var $input = $('[data-plugin="{{ $formId }}switchery"]');
  12. $input.parent().find('.switchery').remove();
  13. $input.each(function() {
  14. new Switchery($(this)[0], $(this).data())
  15. })
  16. </script>