trait HasErrorBag

Trait HasErrorBag.

Provides utilities to check for validation errors on component properties.

Methods

array
getErrorState(ComponentAttributeBag|null $attributes = null, ViewErrorBag|MessageBag|null $errors = null, string|null $error = null)

Determine the error state for a specific field.

Details

at line 24
array getErrorState(ComponentAttributeBag|null $attributes = null, ViewErrorBag|MessageBag|null $errors = null, string|null $error = null)

Determine the error state for a specific field.

Checks both the session error bag and specific error attributes. Looks up errors by wire:model value or name attribute.

Parameters

ComponentAttributeBag|null $attributes

Component attributes.

ViewErrorBag|MessageBag|null $errors

Global error bag.

string|null $error

Specific error message override.

Return Value

array

[hasError, firstErrorMessage]