Hidden

_Hidden('name_attribute')
You may also set a default value from a Komponent prop.
_Hidden('name_attribute')
   ->value($this->prop('some_value'))
Or from one of your model's attributes.
_Hidden('name_attribute')
   ->value($this->model->attribute)

Preview

No preview available for this element

Field specific

MethodParametersComment
->name($name, $interactsWithModel)
string|array $name
The name attribute of the field.
null|bool $interactsWithModel
ref. ignoresToModel method
Sets the name for the field corresponding the attribute it will fill.
->placeholder($placeholder)
string $placeholder
The placeholder for the field.
Sets the placeholder of this field. By default, the fields have no placeholder.
->value($value)
string|array $value
The value to be set.
Sets the value of the field for the output (display) phase. Note: if the Form is connected to an Eloquent Model, the DB value takes precedence.
->value($value)
string|array $value
The value to be set.
Sets the value of the field for the output (display) phase. Note: if the Form is connected to an Eloquent Model, the DB value takes precedence.
->default($defaultValue)
string $defaultValue
The default value
Sets a default value to the field. Applies if the value is empty.
->readOnly()
-
Makes the field readonly (not editable).
->noAutocomplete()
-
Removes the browser's default autocomplete behavior from the field.

Eloquent specific

MethodParametersComment
->ignoresModel()
-
Autosaving for this field is disabled. Developers will have to write the logic themselves.
->doesNotFill()
-
Has a value but it is not persisted in DB.
->extraAttributes($attributes)
array $attributes
Constant columns/values pairs (associative array).
This specifies extra attributes (constant columns/values) to add to the model.

HTML attributes

MethodParametersComment
->id($id)
string $id
The id attribute.
Sets the id attribute of the element.
->class($classes)
string $classes
The class attribute.
Sets the class attribute of the element. For multiple classes, use a space-separated string.
->removeClass($classes)
string $classes
Removes a class or space separated classes from the element.
->style($styles)
string $styles
The CSS style attribute.
Sets the style attribute of the element. For multiple styles, use a ";" separated string.
->attr($attributes)
array|string|null $attributes
Associative array of attribute names and values.
Sets HTML attributes to the element. For example:
->attr([
    'title' => 'Some title',
    'data-target' => '#target-id'
])
->title($title)
string $title
The HTML title attribute
Sets the HTML title attribute of the element.
->disabled()
-
Disables the element. Useful in _Select()->options(...) for example to disable an option.
->inputClass($classes)
string $classes
The class attribute.
Sets the class attribute for the input element of the field. For multiple classes, use a space-separated string.
->inputStyle($style)
string $style
The CSS style attribute.
Sets the style attribute for the input element of the field. For multiple styles, use a ";" separated string.
->noMargins()
-
Removes the default margin applied to fields. To disable ALL the fields in a form, use the $noMargins property on the Form.

Testing & Customization

MethodParametersComment
->dusk($selector)
array $selector
Dusk selector attribute.
Sets a dusk selector attribute to the element..
->config($config)
array $config
Key/value associative array.
Pass additional config to the element that can be accessed from the Front-end in the config property of the object - especially useful if you wish to customize or add new features to the component.

Validation

It is recommended that you group validations in the rules() method of your Komponent (better for readability and long-term maintenance), but if for some reason, you have a use case that requires it, you may also set rules directly on the Element with these methods.
MethodParametersComment
->rules($rules)
string|array $rules
A | separated string of validation rules or Array of rules.
Appends Laravel input validation rules for the field.
->required(The)
string|null The
required indicator Html. The default is (*).
Sets a required (*) indicator and adds a required validation rule to the field.