checkbox.blade.php 743 B

1234567891011121314151617181920212223242526272829
  1. <div class="{{$viewClass['form-group']}}" >
  2. <label class="{{$viewClass['label']}} control-label pt-0">{!! $label !!}</label>
  3. <div class="{{$viewClass['field']}}">
  4. @if($checkAll)
  5. {!! $checkAll !!}
  6. <hr style="margin-top: 10px;margin-bottom: 0;">
  7. @endif
  8. @include('admin::form.error')
  9. {!! $checkbox !!}
  10. <input type="hidden" name="{{$name}}[]">
  11. @include('admin::form.help-block')
  12. </div>
  13. </div>
  14. @if(! empty($canCheckAll))
  15. <script init="[name='_check_all_']" once>
  16. $this.on('change', function () {
  17. $(this).parents('.form-field').find('input[type="checkbox"]:not(:first)').prop('checked', this.checked).trigger('change');
  18. });
  19. </script>
  20. @endif