You could do this:
$messages = [
'params.*' => 'Some of the words are invalid.',
];
EDIT:
I think I may have found a solution:
First, make sure you import both Validator and HttpResponseException at the top:
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Http\Exceptions\HttpResponseException;
Then, you can override the native failedValidation
method and alter your errors however you want:
protected function failedValidation(Validator $validator)
{
// Get all the errors thrown
$errors = collect($validator->errors());
// Manipulate however you want. I'm just getting the first one here,
// but you can use whatever logic fits your needs.
$error = $errors->unique()->first();
// Either throw the exception, or return it any other way.
throw new HttpResponseException(response(
$error,
422
));
}