本文介绍了Laravel显示验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下代码:

                @foreach($errors->all() as $error)
                    <li>{!!   $error !!}</li>
                @endforeach

并且鉴于此:

我希望该错误能够正确显示.例如姓名为必填项.

I would like the error to be displayed correctly.exemple The name is required.

在调试器中,我可以看到.如何替换验证.要求输入名称"时必填

In debbuger I can see.How to replace validation.required upon "The name is required"

推荐答案

好,我发现了错误.我没有其他语言可以上传.在文件app/config.php中,将'locale'=>'pl'替换为'en'

Ok, I found mistake. I didn't have another language to upload.In file app/config.php replace 'locale' => 'pl' to 'en'

这篇关于Laravel显示验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 12:00
查看更多