In my laravel
-application I have some input fields like this:
<input name="phone" type="tel" pattern="^[0-9-+s()]*$" class="form-control" placeholder="Telefonnr." required>
<input name="subject" type="text" class="form-control" placeholder="Thema" required>
...and so on
and in my Controller I have this:
$validator = Validator::make(request()->all(), [
'email' => ['required', 'email'],
'name' => ['required', 'string'],
'phone' => ['string'],
'subject' => ['required', 'string'],
'message' => ['required', 'string'],
'conditions' => ['accepted', 'boolean'],
]);
So far so good, but now I want to customize the error messages. Right now, the error messages are like:
"subject muss ausgefüllt sein"
or
"phone muss angegeben sein"
So, how can I change it to:
"Thema muss ausgefüllt sein"
or
"Telefonnummer muss angegeben sein"