Skip to content

Textarea

Multi line plain text, e.g. notes or a description. For formatted text use the MarkdownEditor.

use Anvil\Schema\Fields\Textarea;
Textarea::make('notes')->rows(6)->columnSpanFull(),
Textarea::make('reason')->required()->maxLength(500)->helperText('Shown to the applicant.'),
Textarea::make('log')->maxLength(null), // no length limit
Option Effect Default
rows(n) visible lines, at least 2 4
maxLength(n) rule max_length[n]; null for no limit 10000

Plus the options of every field. In a form with several columns a textarea usually gets columnSpanFull().

The text, trimmed at the start and end; line breaks inside are kept. An empty optional field is saved as null.

string, max_length[n] (unless maxLength(null)), then the rules of rules().

The text with its line breaks, escaped (no HTML).

A string with maxLength.