// Первый вариант
return back()->withErrors(['Внимание! ...'])->withInput();
{{-- Вывод списка ошибок --}}
@if(!is_null($errors->all()))
@foreach($errors->all() as $error)
<div class="row justify-content-center">
<div class="col-md-11">
<div class="alert alert-danger alert-dismissible fade show" role="alert">
{{ $error }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
@endforeach
@endif
// Второй варинат
return back()->with(['errors' => ['error' => 'Внимание! ...']]);
{{-- Вывод списка ошибок--}}
@if(!is_null(session('errors')))
@foreach(session('errors') as $error)
<div class="row justify-content-center">
<div class="col-md-11">
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ $error}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
</div>
</div>
@endforeach
@endif