protected $_databaseUnique = false;
protected $_databaseIndex = false;
protected $_translatable = false;
+ protected $_viewNamespace = 'crud::fields';
protected $_databaseAttributes = [];
public function getDefaultAttributes()
{
- return ['type' => $this->_adminType, 'column' => false, 'form' => 'both', 'rules' => '',
+ return ['type' => $this->_adminType, 'view_namespace' => $this->_viewNamespace, 'column' => false, 'form' => 'both', 'rules' => '',
'fillable' => true, 'guarded' => false, 'hidden' => false, 'translatable' => $this->_translatable,
'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast,
'allow_null' => true,
namespace Cubist\Backpack\app\Magic\Fields;
-
class Range extends Field
{
- protected $_adminType = 'range';
+ protected $_adminType = 'rangeofvalues';
+ protected $_viewNamespace = 'cubist_back::fields';
}
--- /dev/null
+<!-- field_type_name -->
+<div @include('crud::inc.field_wrapper_attributes') >
+ <label>{!! $field['label'] !!}</label>
+ <div @include('crud::inc.field_attributes')>
+ <input
+ type="text"
+ name="{{ $field['name'] }}[min]"
+ >
+ <input
+ type="text"
+ name="{{ $field['name'] }}[max]"
+ >
+ </div>
+
+ {{-- HINT --}}
+ @if (isset($field['hint']))
+ <p class="help-block">{!! $field['hint'] !!}</p>
+ @endif
+</div>
+
+@if ($crud->checkIfFieldIsFirstOfItsType($field))
+ {{-- FIELD EXTRA CSS --}}
+ {{-- push things in the after_styles section --}}
+
+ @push('crud_fields_styles')
+ <!-- no styles -->
+ @endpush
+
+ {{-- FIELD EXTRA JS --}}
+ {{-- push things in the after_scripts section --}}
+
+ @push('crud_fields_scripts')
+ <!-- no scripts -->
+ @endpush
+@endif