checkbox.blade.php 734 B

1234567891011121314151617181920212223242526272829
  1. <div class="{{$viewClass['form-group']}}" >
  2. <label for="{{$id}}" class="{{$viewClass['label']}} control-label pt-0">{!! $label !!}</label>
  3. <div class="{{$viewClass['field']}}" id="{{ $id }}">
  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 once>
  16. $('[name="_check_all_"]').on('change', function () {
  17. $(this).parents('.form-field').find('input[type="checkbox"]').prop('checked', this.checked);
  18. });
  19. </script>
  20. @endif