class Repeater extends BaseFormField (View source)

Traits

Properties

bool $renderForBlocks from  RenderForBlocks
protected int|null $max from  HasMax
protected bool $reorder from  CanReorder
protected string|null $type
$buttonAsLink
protected bool $allowCreate
protected string|null $relation
protected array|null $browserModule

Methods

renderForBlocks(bool $renderForBlocks = true)

No description

bool
forBlocks()

No description

__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

name(string $name)

Set the name of the field, if no label is set yet, this method will also update that.

default(mixed $default)

No description

label(string $label)

Set the label of the field, you can use twillTrans('') Laravel translatable strings here.

note(string $note)

Add a note to the field to display on the form.

required(bool $required = true)

Marks the field as mandatory, however you still need to add validation rules.

disabled(bool $disabled = true)

Marks the field as disabled.

connectedTo(string $fieldName, mixed $fieldValues, array $options = [])

No description

View
render()

No description

array
getAdditionalConstructorArguments()

In render we dynamically build the constructor arguments.

max(int $max)

Sets the max amount of items.

from  HasMax
disableReorder(bool $disableReorder = true)

Disables the reordering of items.

type(string $type)

The name of the repeater, this also sets the name of field if not set yet.

buttonAsLink(bool $buttonAsLink = true)

Instead of a button show a link to add a new one.

relation(string|null $relation = null)

No description

allowCreate(bool $allowCreate = true)

No description

browserModule(array|null $browserModule = null)

No description

Details

RenderForBlocks renderForBlocks(bool $renderForBlocks = true)

No description

Parameters

bool $renderForBlocks

Return Value

RenderForBlocks

bool forBlocks()

No description

Return Value

bool

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

Parameters

string $component
string|null $name
string|null $label
string|null $note
bool|null $required
bool|null $disabled
mixed $default
mixed $connectedTo
array $mandatoryProperties

static BaseFormField make()

No description

Return Value

BaseFormField

BaseFormField name(string $name)

Set the name of the field, if no label is set yet, this method will also update that.

Parameters

string $name

Return Value

BaseFormField

BaseFormField default(mixed $default)

No description

Parameters

mixed $default

Return Value

BaseFormField

BaseFormField label(string $label)

Set the label of the field, you can use twillTrans('') Laravel translatable strings here.

Parameters

string $label

Return Value

BaseFormField

BaseFormField note(string $note)

Add a note to the field to display on the form.

Parameters

string $note

Return Value

BaseFormField

BaseFormField required(bool $required = true)

Marks the field as mandatory, however you still need to add validation rules.

Parameters

bool $required

Return Value

BaseFormField

BaseFormField disabled(bool $disabled = true)

Marks the field as disabled.

There might be some fields not supporting this.

Parameters

bool $disabled

Return Value

BaseFormField

connectedTo(string $fieldName, mixed $fieldValues, array $options = [])

No description

Parameters

string $fieldName
mixed $fieldValues
array $options

View render()

No description

Return Value

View

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.

Return Value

array

HasMax max(int $max)

Sets the max amount of items.

Parameters

int $max

Return Value

HasMax

CanReorder disableReorder(bool $disableReorder = true)

Disables the reordering of items.

Parameters

bool $disableReorder

Return Value

CanReorder

Repeater type(string $type)

The name of the repeater, this also sets the name of field if not set yet.

Parameters

string $type

Return Value

Repeater

Instead of a button show a link to add a new one.

Parameters

bool $buttonAsLink

Return Value

Repeater

Repeater relation(string|null $relation = null)

No description

Parameters

string|null $relation

Return Value

Repeater

Repeater allowCreate(bool $allowCreate = true)

No description

Parameters

bool $allowCreate

Return Value

Repeater

Repeater browserModule(array|null $browserModule = null)

No description

Parameters

array|null $browserModule

Return Value

Repeater