Browser
class Browser extends BaseFormField (View source)
Traits
Properties
bool | $renderForBlocks | from RenderForBlocks | |
protected bool | $translated | from IsTranslatable | |
protected int|null | $max | from HasMax | |
protected string|null | $fieldNote | from HasFieldNote | |
protected bool | $buttonOnTop | from CanHaveButtonOnTop | |
protected string|null | $moduleName | ||
protected array | $modules | ||
protected array | $endpoints | ||
protected array | $params | ||
protected string|null | $browserNote | ||
protected string|null | $itemLabel | ||
protected bool | $wide | ||
protected bool | $sortable | ||
protected string|null | $routePrefix | ||
protected string|null | $connectedBrowserField |
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.
Shows the browse button above instead of below the list of items.
A note to display inside the browser.
For more control over the modules.
Set a custom route prefix if needed.
Conditionally show this field based on another browser 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
HasMax at line 12
HasMax
max(int $max)
Sets the max amount of items.
HasFieldNote
fieldNote(string $fieldNote)
Adds a note.
CanHaveButtonOnTop
buttonOnTop(bool $buttonOnTop = true)
Shows the browse button above instead of below the list of items.
Browser
params(array $params)
Additional parameters to pass to the module route.
Browser
endpoints(array $endpoints)
A list of custom endpoints to use.
Browser
browserNote(string $browserNote)
A note to display inside the browser.
Browser
itemLabel(string $itemLabel)
The label to display for items, defaults to the field label.
Browser
modulesCustom(array $modules)
For more control over the modules.
Cannot be used together with modules.
Provide an array with: label, name, routePrefix, params
Browser
wide(bool $wide = true)
Makes the modal window use the full width.
Browser
sortable(bool $sortable = true)
Makes the columns in the browser sortable.
Browser
routePrefix(string $routePrefix)
Set a custom route prefix if needed.
Browser
connectedBrowserField(string $connectedBrowserField)
Conditionally show this field based on another browser field.
Browser
modules(array $modules)
A list of modules that can be be selected in the browser modal.