laravel/framework — pull request #30 by aajhiggs (2013-01-14 00:08:28+00:00)
Title: Exposed :key (in addition to :message)

I have found use case where I could do with the key of the error array exposed (proposing :key).

If I echo out my errors, on some occasions I output the errors in a single block then treat them using JS (usually moving them to an element on the page by the ID stored in a data attribute).

If I want to print
:message
, I cannot currently access the :key part (where :key is the ID of the associated field).

Being able to do this (as adjusted) allows a user to identify exactly what field an individual message was associated with e.g. when using ->all(), and is a simple exposure of data already held in the object.