{{-- radio --}} @php $optionValue = old_empty_or_null($field['name'], '') ?? $field['value'] ?? $field['default'] ?? ''; // check if attribute is casted, if it is, we get back un-casted values if(Arr::get($crud->model->getCasts(), $field['name']) === 'boolean') { $optionValue = (int) $optionValue; } // if the class isn't overwritten, use 'radio' if (!isset($field['attributes']['class'])) { $field['attributes']['class'] = 'radio'; } $field['wrapper'] = $field['wrapper'] ?? $field['wrapperAttributes'] ?? []; $field['wrapper']['data-init-function'] = $field['wrapper']['data-init-function'] ?? 'bpFieldInitRadioElement'; @endphp @include('crud::fields.inc.wrapper_start') @include('crud::fields.inc.translatable_icon') @if( isset($field['options']) && $field['options'] = (array)$field['options'] ) @foreach ($field['options'] as $value => $label )
@endforeach @endif {{-- HINT --}} @if (isset($field['hint']))

{!! $field['hint'] !!}

@endif @include('crud::fields.inc.wrapper_end') {{-- ########################################## --}} {{-- Extra CSS and JS for this particular field --}} {{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} {{-- FIELD JS - will be loaded in the after_scripts section --}} @push('crud_fields_scripts') @bassetBlock('backpack/crud/fields/radio-field.js') @endBassetBlock @endpush {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}