diff --git a/src/resources/views/fields/toggle.blade.php b/src/resources/views/fields/toggle.blade.php new file mode 100644 index 0000000000..95e00f4724 --- /dev/null +++ b/src/resources/views/fields/toggle.blade.php @@ -0,0 +1,103 @@ + +@php + $optionPointer = 0; + $optionValue = old($field['name']) ? old($field['name']) : (isset($field['value']) ? $field['value'] : (isset($field['default']) ? $field['default'] : '' )); +@endphp + +
+ +
+ +
+ + @if( isset($field['options']) && is_array($field['options']) ) + + @foreach ($field['options'] as $value => $label ) + @php ($optionPointer++) + + @if( isset($field['inline']) && $field['inline'] ) + + + + @else + +
+ +
+ + @endif + + @endforeach + + @endif + + {{-- HINT --}} + @if (isset($field['hint'])) +

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

+ @endif + +
+ +{{-- ########################################## --}} +{{-- 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 --}} +@if ($crud->checkIfFieldIsFirstOfItsType($field, $fields)) + + {{-- FIELD CSS - will be loaded in the after_styles section --}} + @push('crud_fields_styles') + + @endpush + + {{-- FIELD JS - will be loaded in the after_scripts section --}} + @push('crud_fields_scripts') + + @endpush + +@endif +{{-- End of Extra CSS and JS --}} +{{-- ########################################## --}}