I would like to use the default laravel function to show an error, but in a different language. I don't need a "nice name", but it's a translation for the value **: attribute in lang files. Right now if I just use:
<input type="text" placeholder="{{ trans('generic.phone') }}" name="phone" value="{{ old('phone') }}"> @if ($errors->has('phone')) <span class="help-block"> <strong>{{ $errors->first('phone') }}</strong> </span> @endif
It works fine, because : the attribute occupies the phone field, and in the verification language I:
'required' => 'The :attribute field is required.',
But how to manage the phone field with a language file?
Should I write a custom error for each field? Please say no.
The following function is just a wrong example so that you can understand what I'm trying to do
@if ($errors->has('phone')) <strong>{{ $errors->first(trans('generic.phone')) }}</strong> @endif
Vixed Jan 27 '17 at 15:20 2017-01-27 15:20
source share