--- /dev/null
+<?php
+
+namespace Cubist\Backpack\Magic\Fields;
+
+use Cubist\Backpack\CubistBackpackServiceProvider;
+
+class CheckboxBasic extends Checkbox
+{
+ protected $_adminType = 'checkboxbasic';
+ protected $_viewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::fields';
+}
--- /dev/null
+<!-- checkbox field -->
+
+@include('crud::fields.inc.wrapper_start')
+@include('crud::fields.inc.translatable_icon')
+<div class="checkbox">
+ @php $id='cb_'.rand(100,1000000000); @endphp
+ <input type="hidden" name="{{ $field['name'] }}" value="0">
+ <input id="{{$id}}" name="{{ $field['name'] }}" type="checkbox" value="1"
+ @if (old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? false)
+ checked="checked"
+ @endif
+
+ @if (isset($field['attributes']))
+ @foreach ($field['attributes'] as $attribute => $value)
+ @if($attribute==='name' || $attribute==='value')
+ @continue
+ @endif
+ {{ $attribute }}="{{ $value }}"
+ @endforeach
+ @endif
+ >
+ <label for="{{$id}}" class="form-check-label font-weight-normal">{!! $field['label'] !!}</label>
+
+ {{-- HINT --}}
+ @if (isset($field['hint']))
+ <p class="help-block">{!! $field['hint'] !!}</p>
+ @endif
+</div>
+@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 --}}
+@if ($crud->fieldTypeNotLoaded($field))
+ @php
+ $crud->markFieldTypeAsLoaded($field);
+ @endphp
+ {{-- FIELD JS - will be loaded in the after_scripts section --}}
+ @push('crud_fields_scripts')
+ @endpush
+
+@endif
+{{-- End of Extra CSS and JS --}}
+{{-- ########################################## --}}