laravel-lang
laravel-lang copied to clipboard
字段 验证提示 还是英文
Laravel Framework 8.68.0
"overtrue/laravel-lang": "^5.0",
app.php 设置 'locale' => 'zh_CN', 验证 提示 是 phone 必须介于 3 - 10 个字符之间。
, 这个 phone 字段 在 validation-attributes.php 文件中 有定义, 没有 将 phone
提示为手机
。
猜测: validation-attributes.php
和 validation-inline.php
都没有起作用
在 validation.php
文件中 添加
'attributes' => [
'phone' => '手机号',
],
这样 才有作用
官方文档的说法只有一种哦: https://laravel.com/docs/8.x/validation#specifying-attribute-in-language-files
关于 validation-attributes.php 和 validation-inline.php
的问题,我看看 laravel-lang/lang 做了啥,官方貌似不支持这俩
@gyp719 查了一下,这个变动比较大,需要改文件发布逻辑来合并这俩文件到 validation.php
,暂时没时间改,推荐使用 https://github.com/ARCANEDEV/LaravelLang 或者 https://github.com/andrey-helldar/laravel-lang-publisher 来管理,他们的功能比较全
@overtrue 好的,谢谢大佬。