Input
class Input extends BaseFormField (View source)
Traits
Constants
TYPE_TEXT |
|
TYPE_NUMBER |
|
TYPE_TEXTAREA |
|
TYPE_EMAIL |
|
TYPE_URL |
|
Properties
bool | $renderForBlocks | from RenderForBlocks | |
protected bool | $translated | from IsTranslatable | |
protected int|null | $min | from HasMin | |
protected int|null | $max | from HasMax | |
protected int|null | $maxlength | from HasMaxlength | |
protected string|null | $placeholder | from HasPlaceholder | |
protected bool|null | $readOnly | from HasReadOnly | |
protected string|null | $direction | from HasDirection | |
protected string|null | $ref | from HasOnChange | |
protected string|null | $onChange | from HasOnChange | |
protected string|null | $onChangeAttribute | from HasOnChange | |
protected string | $type | ||
protected string | $prefix | ||
protected string|null | $mask | ||
protected int|null | $rows |
Methods
No description
No description
Set the name of the field, if no label is set yet, this method will also update that.
Set the label of the field, you can use twillTrans('') Laravel translatable strings here.
Marks the field as mandatory, however you still need to add validation rules.
No description
In render we dynamically build the constructor arguments.
Makes the field translatable.
Sets the placeholder of the field.
Details
RenderForBlocks
renderForBlocks(bool $renderForBlocks = true)
No description
bool
forBlocks()
No description
protected
__construct(string $component, string|null $name = null, string|null $label = null, string|null $note = null, bool|null $required = false, bool|null $disabled = false, mixed $default = null, mixed $connectedTo = null, array $mandatoryProperties = [])
No description
static BaseFormField
make()
No description
BaseFormField
name(string $name)
Set the name of the field, if no label is set yet, this method will also update that.
BaseFormField
default(mixed $default)
No description
BaseFormField
label(string $label)
Set the label of the field, you can use twillTrans('') Laravel translatable strings here.
BaseFormField
note(string $note)
Add a note to the field to display on the form.
BaseFormField
required(bool $required = true)
Marks the field as mandatory, however you still need to add validation rules.
BaseFormField
disabled(bool $disabled = true)
Marks the field as disabled.
There might be some fields not supporting this.
connectedTo(string $fieldName, mixed $fieldValues, array $options = [])
No description
View
render()
No description
protected array
getAdditionalConstructorArguments()
In render we dynamically build the constructor arguments.
In exceptional cases such as browser we have more conditionals and we can use this method to set those.
IsTranslatable
translatable(bool $translatable = true)
Makes the field translatable.
in
HasMin at line 12
HasMin
min(int $min)
Sets the minimum amount of items.
in
HasMax at line 12
HasMax
max(int $max)
Sets the max amount of items.
HasMaxlength
maxLength(string $maxlength)
Sets the max character length.
HasPlaceholder
placeholder(string $placeholder)
Sets the placeholder of the field.
HasReadOnly
readOnly(bool $readOnly = true)
Marks the field as read only.
HasDirection
direction(string $direction)
Sets the direction of the field.
HasOnChange
ref(string $ref)
The field to act on.
HasOnChange
onChange(string $onChange)
Javascript to execute on change.
HasOnChange
onChangeAttribute(string $onChangeAttribute)
Attribute to change.
Input
prefix(string $prefix)
Text to display (inside) before the actual input.
Input
type(string $type)
The type of input field like: text, number, email, .
.
Input
mask(string $mask)
Apply a mask to field based on alpinjs mask.
This only works with Input::TYPE_TEXT
Input
rows(int $rows)
The amount of rows, only used with textarea type.