switchfield.blade.php 655 B

12345678910111213141516171819202122
  1. <div class="{{$viewClass['form-group']}}">
  2. <label 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 }}" {{ $value == 1 ? 'checked' : '' }} {!! $attributes !!} />
  7. @include('admin::form.help-block')
  8. </div>
  9. </div>
  10. <script require="@switchery" init="{!! $selector !!}">
  11. $this.parent().find('.switchery').remove();
  12. $this.each(function() {
  13. new Switchery($(this)[0], $(this).data())
  14. })
  15. </script>