默认解决方案很简单:
@if (count($errors) > 0)
<ul id="login-validation-errors" class="validation-errors">
@foreach ($errors->all() as $error)
<li class="validation-error-item">{{ $error }}</li>
@endforeach
</ul>
@endif
我可以在任何地方写errors.blade.php
个.
Is there any way to extract each element and display it next to input field that holds the value that failed?
I assume that would require me to define a lot of conditional if
statements next to each input, right?
How to sort this problem? Could you give me any examples?
谢谢.