Extending Laravel's Validator Class

88 Views Asked by At

I am using the Laravel's validator class, and when validation fails I print out the errors with this method:

$validator->messages();

The method returns a multi dimensional array, I need a single dimensional array.

$validator->net_method();

How will I go about extending a new method to return the errors in a different format?

0

There are 0 best solutions below