public getErrors ( string $attribute = null ) : array | ||
$attribute | string | attribute name. Use null to retrieve errors for all attributes. |
return | array | errors for all attributes or the specified attribute. Empty array is returned if no error. Note that when returning errors for all attributes, the result is a two-dimensional array, like the following: ```php [ 'username' => [ 'Username is required.', 'Username must contain only word characters.', ], 'email' => [ 'Email address is invalid.', ] ] ``` |