Built-in field types and how to create custom ones
Field Type | Key | Data Type | Description |
---|---|---|---|
Text Input | text | String | Basic text input with validation |
Textarea | textarea | Text | Multi-line text input |
Number | number | Numeric | Numeric input with min/max validation |
Currency | currency | Numeric | Currency formatting with locale support |
Link | link | String | URL validation and formatting |
Rich Editor | rich-editor | Text | WYSIWYG editor with formatting |
Markdown Editor | markdown-editor | Text | Markdown syntax with preview |
Tags Input | tags-input | JSON | Multiple tags with autocomplete |
Select | select | String | Single selection dropdown |
Multi-Select | multi-select | JSON | Multiple selections |
Radio | radio | String | Single choice radio buttons |
Checkbox | checkbox | Boolean | Simple true/false toggle |
Checkbox List | checkbox-list | JSON | Multiple checkboxes |
Toggle | toggle | Boolean | Switch-style toggle |
Toggle Buttons | toggle-buttons | String | Button group selection |
Date | date | Date | Date picker |
Date Time | datetime | DateTime | Date and time picker |
Color Picker | color-picker | String | Visual color selection |
FieldTypeDefinitionInterface
:
AbstractFormComponent
:
AbstractTableColumn
:
AbstractInfolistEntry
:
AbstractFormComponent
and implement the create()
methodAbstractTableColumn
and implement the make()
methodAbstractInfolistEntry
and implement the make()
methodHasCommonFieldProperties
trait provides default implementations for:
getTableFilterClass()
- Returns null by defaultisSearchable()
- Returns true by defaultisSortable()
- Returns true by defaultisFilterable()
- Returns false by defaultisEncryptable()
- Returns false by defaultSelect
, TextInput
, etc.star-rating
, country-select
)HasCommonFieldProperties
trait for defaultsFieldTypeDefinitionInterface
php artisan cache:clear
create()
for forms, make()
for tables/infolists)$this->getFieldName($customField)
for the field name