I
I
igordata12020-06-05 14:49:08
Laravel
igordata1, 2020-06-05 14:49:08

How to display validation errors in view?

<form action="/settings/store" method="POST">
    {{ csrf_field() }}
    <input type="text" name="age" placeholder="Укажите возраст" value="{{ old('age') }}" id="age">
    <input type="text" name="fio" placeholder="Укажите ФИО">
    <input type="textarea" name="about" placeholder="описание">
    <input type="submit" value="Отправить">
</form>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Anton, 2020-06-05
@Fragster

https://laravel.com/docs/7.x/validation#quick-disp...

J
jazzus, 2020-06-05
@jazzus

@error('age')
  {{ $message }}
@enderror

I recommend taking some video course on crud operations / working with forms and mastering the DD helper for debugging. Will answer many questions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question