radio-group.blade.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. @props([
  2. 'name',
  3. 'label' => null,
  4. 'options' => [],
  5. 'attribute' => null,
  6. 'help' => [],
  7. 'inline' => true,
  8. 'label_grid' => 'col-xxl-2 col-lg-3 col-sm-4',
  9. 'input_grid' => 'col-auto',
  10. 'container' => 'form-group row',
  11. ])
  12. <div class="{{ $container }}">
  13. <label class="{{ $label_grid }} col-form-label">{{ $label }}</label>
  14. <div class="{{ $input_grid }}">
  15. <ul class="list-unstyled{{ $inline ? ' list-inline' : '' }}">
  16. @foreach ($options as $value => $text)
  17. <li class="{{ $inline ? 'list-inline-item' : '' }}">
  18. <div class="radio-custom radio-primary">
  19. <input id="{{ $name }}_{{ $value }}" name="{{ $name }}" type="radio" value="{{ $value }}"
  20. {{ $attribute }} />
  21. <label for="{{ $name }}_{{ $value }}">{{ $text }}</label>
  22. </div>
  23. </li>
  24. @endforeach
  25. </ul>
  26. @if ($help)
  27. <span class="text-help">{{ $help }}</span>
  28. @endif
  29. </div>
  30. </div>