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 limitOptions
Section titled “Options”| 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().
Saved value
Section titled “Saved value”The text, trimmed at the start and end; line breaks inside are kept. An
empty optional field is saved as null.
Validation
Section titled “Validation”string, max_length[n] (unless maxLength(null)), then the rules of
rules().
Read-only
Section titled “Read-only”The text with its line breaks, escaped (no HTML).
A string with maxLength.