Reputation: 57
When I used Laravel 5.8 I could get information about errors like this :
@if(count($errors > 0))
<ul class="error-list" >
@foreach($errors->all() as $error)
<li class="error-list-element">{{$error}}</li>
@endforeach
</ul>
@endif
It worked completly fine. Since Laravel 6.0 was released the code above results in error :
Object of class Illuminate\Support\ViewErrorBag could not be converted to int
So how can I get information about errors in Laravel 6.0?
Upvotes: 1
Views: 121
Reputation: 340
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
Upvotes: 1
Reputation: 1104
Here is code :
@if ($errors->any())
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
Hope this will help :)
Upvotes: 2