A message is a template such as The :attribute field is required., filled with the field name (underscores become spaces), the rule's parameters, and :input for the value sent. In a form request, messages() overrides one per field.rule and attributes() renames fields in every message. The bookshop's return ['sku.unique' => 'Another book already uses SKU :input.', 'price.decimal' => 'Enter the :attribute in dollars and cents, like 19.99.'] and ['category_id' => 'category', 'price' => 'list price']. For app-wide wording, php artisan lang:publish copies the framework's language files into lang/en; the bookshop set the required line of validation.php to 'Please enter the :attribute.':
$ curl -s $A -H "$H" -H "$J" -d 'name=&sku=BK-1001&category_id=9&format=ebook&price=12.999' \
$B/products | errs
name: Please enter the name.
sku: Another book already uses SKU BK-1001.
category_id: The selected category is invalid.
price: Enter the list price in dollars and cents, like 19.99.messages() beats the language file's custom array, which beats its rule lines. Other locales sit beside it (lang/de/validation.php), chosen by APP_LOCALE or App::setLocale().