Skip to main content

Module messages

Module messages 

Source
Expand description

Default messages, placeholder interpolation, and per-field overrides.

Laravel keeps its messages in lang/en/validation.php with :attribute style placeholders, and lets an application override one message for one field. That split matters: the defaults have to be good enough that nobody writes them out again, and the override has to be reachable for the one field where the default reads wrong (“The g-recaptcha-response field is required” is never what a user should see).

Structs§

Messages
Message defaults, plus whatever the application overrode.

Enums§

SizeKind
Which of the three readings of a size rule applies to a value.

Functions§

default_template
The built-in English message for a rule, adapted from Laravel’s en set.
format_number
Render a bound the way a person writes it: 3, not 3.0.
format_values
Join rule parameters for the :values placeholder.
interpolate
Replace :name placeholders. Unknown placeholders are left alone so a typo in an override is visible in the output instead of silently vanishing.