class Wysiwyg extends BaseFormField (View source)

Traits

Properties

bool $renderForBlocks from  RenderForBlocks
protected bool $translated from  IsTranslatable
protected int|null $maxlength from  HasMaxlength
protected string|null $placeholder from  HasPlaceholder
protected string|null $direction from  HasDirection
protected string|null $ref from  HasOnChange
protected string|null $onChange from  HasOnChange
protected string|null $onChangeAttribute from  HasOnChange
bool $hideCounter
bool $editSource
array|null $toolbarOptions
protected TiptapWrapper[] $tiptapWrappers
array|null $options
string $type
bool $limitHeight
bool $syntax
string $customTheme
array|null $customOptions
array|null $browserModules
array|null $classList

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.

translatable(bool $translatable = true)

Makes the field translatable.

maxLength(string $maxlength)

Sets the max character length.

placeholder(string $placeholder)

Sets the placeholder of the field.

direction(string $direction)

Sets the direction of the field.

ref(string $ref)

The field to act on.

onChange(string $onChange)

Javascript to execute on change.

onChangeAttribute(string $onChangeAttribute)

Attribute to change.

hideCounter(bool $hideCounter = true)

Hides the character counter.

allowSource(bool $allowSource = true)

Adds a edit source button.

toolbarOptions(array $toolbarOptions)

Allows you to set custom toolbar options. This depends on the editor used.

options(array $options)

Allows you to set editor options. This depends on the editor used.

type(string $type)

The type of editor to use, defaults to quill, options are: tiptap

limitHeight(bool $limitHeight = true)

Limits the height of the editor, otherwise grows infinitely.

syntax(bool $syntax = true)

Enables syntax highlight.

customTheme(string $customTheme)

Set a custom theme for the syntax highlighter.

customOptions(array $customOptions)

Additional custom options.

addTiptapWrapper(TiptapWrapper $wrapper)

Add wrappers that can be used in the editor.

array
getToolbarOptions()

No description

browserModules(array|null $modules = null)

The browser module(s) that can be used to select existing content.

classList(array $list)

Assosiative array ['class' => 'Label'] of classes than will be available to editor in the form of checkboxes when creating new link in modal

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

IsTranslatable translatable(bool $translatable = true)

Makes the field translatable.

Parameters

bool $translatable

Return Value

IsTranslatable

HasMaxlength maxLength(string $maxlength)

Sets the max character length.

Parameters

string $maxlength

Return Value

HasMaxlength

HasPlaceholder placeholder(string $placeholder)

Sets the placeholder of the field.

Parameters

string $placeholder

Return Value

HasPlaceholder

HasDirection direction(string $direction)

Sets the direction of the field.

Parameters

string $direction

Return Value

HasDirection

HasOnChange ref(string $ref)

The field to act on.

Parameters

string $ref

Return Value

HasOnChange

HasOnChange onChange(string $onChange)

Javascript to execute on change.

Parameters

string $onChange

Return Value

HasOnChange

HasOnChange onChangeAttribute(string $onChangeAttribute)

Attribute to change.

Parameters

string $onChangeAttribute

Return Value

HasOnChange

Wysiwyg hideCounter(bool $hideCounter = true)

Hides the character counter.

Parameters

bool $hideCounter

Return Value

Wysiwyg

Wysiwyg allowSource(bool $allowSource = true)

Adds a edit source button.

Parameters

bool $allowSource

Return Value

Wysiwyg

Wysiwyg toolbarOptions(array $toolbarOptions)

Allows you to set custom toolbar options. This depends on the editor used.

Parameters

array $toolbarOptions

Return Value

Wysiwyg

Wysiwyg options(array $options)

Allows you to set editor options. This depends on the editor used.

Parameters

array $options

Return Value

Wysiwyg

Wysiwyg type(string $type)

The type of editor to use, defaults to quill, options are: tiptap

Parameters

string $type

Return Value

Wysiwyg

Wysiwyg limitHeight(bool $limitHeight = true)

Limits the height of the editor, otherwise grows infinitely.

Parameters

bool $limitHeight

Return Value

Wysiwyg

Wysiwyg syntax(bool $syntax = true)

Enables syntax highlight.

Parameters

bool $syntax

Return Value

Wysiwyg

Wysiwyg customTheme(string $customTheme)

Set a custom theme for the syntax highlighter.

Parameters

string $customTheme

Return Value

Wysiwyg

Wysiwyg customOptions(array $customOptions)

Additional custom options.

Parameters

array $customOptions

Return Value

Wysiwyg

Wysiwyg addTiptapWrapper(TiptapWrapper $wrapper)

Add wrappers that can be used in the editor.

Parameters

TiptapWrapper $wrapper

Return Value

Wysiwyg

protected array getToolbarOptions()

No description

Return Value

array

Wysiwyg browserModules(array|null $modules = null)

The browser module(s) that can be used to select existing content.

Parameters

array|null $modules

Return Value

Wysiwyg

Wysiwyg classList(array $list)

Assosiative array ['class' => 'Label'] of classes than will be available to editor in the form of checkboxes when creating new link in modal

Parameters

array $list

Return Value

Wysiwyg