checkbox.blade.php 875 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * @required string $name
  4. * @required string $label
  5. *
  6. * @optional string $value
  7. */
  8. ?>
  9. <div class="form-group mb-3">
  10. <div class="d-flex justify-content-between">
  11. <div {{ $attributes->merge(['class' => 'form-check form-switch']) }}>
  12. <input class="form-check-input" name="{{$name}}" value="1"
  13. @if(old($name, $value ?? null) == 1) checked @endif
  14. type="checkbox"
  15. id="{{$name}}">
  16. <label class="form-check-label" for="{{$name}}">{{$label}}</label>
  17. </div>
  18. @if(isset($tooltip) && !empty($tooltip))
  19. <span><i data-bs-toggle="tooltip" data-bs-placement="top" title="{{$tooltip}}"
  20. class="fas fa-info-circle"></i></span>
  21. @endif
  22. </div>
  23. </div>
  24. @error($name)
  25. <div class="invalid-feedback">{{$message}}</div>
  26. @enderror