This is the problem that I encounter Undefined variable: errors (View: /var/www/html/laravel.com/resources/views/idsi/new1.blade.php) Thanks in advance for helping.
$this->validate($request, [
'empid' => 'required|empid|unique:employees',
'sname' => 'required|max:100',
'fname' => 'required|max:100',
'mname' => 'required|max:100',
'nname' => 'required|max:100',
]);
@if(count($errors) > 0)
<div class="row">
<div class="col-md-6">
<ul>
@foreach($errors->all() as $error)
<li>{{$error}}</li>
@endforeach
</ul>
</div>
</div>
@endif
For Laravel 5.2 make sure any routes where you will end up rendering a view that wants access to $errors
that the 'web' middleware group is applied.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community