laravel框架如何查询空的信息(Laravel中validation验证 返回中文提示 全局设置的方法)
类别:编程学习 浏览量:1642
时间:2021-10-16 00:16:43 laravel框架如何查询空的信息
Laravel中validation验证 返回中文提示 全局设置的方法更改 resources\lang 目录下边的 validation.php
|
<?php return [ /* |-------------------------------------------------------------------------- | Validation Language Lines |-------------------------------------------------------------------------- | | The following language lines contain the default error messages used by | the validator class. Some of these rules have multiple versions such | as the size rules. Feel free to tweak each of these messages here. | */ 'accepted' => ':attribute必须接受' , 'active_url' => ':attribute必须是一个合法的 URL' , 'after' => ':attribute 必须是 :date 之后的一个日期' , 'after_or_equal' => ':attribute 必须是 :date 之后或相同的一个日期' , 'alpha' => ':attribute只能包含字母' , 'alpha_dash' => ':attribute只能包含字母、数字、中划线或下划线' , 'alpha_num' => ':attribute只能包含字母和数字' , 'array' => ':attribute必须是一个数组' , 'before' => ':attribute 必须是 :date 之前的一个日期' , 'before_or_equal' => ':attribute 必须是 :date 之前或相同的一个日期' , 'between' => [ 'numeric' => ':attribute 必须在 :min 到 :max 之间' , 'file' => ':attribute 必须在 :min 到 :max KB 之间' , 'string' => ':attribute 必须在 :min 到 :max 个字符之间' , 'array' => ':attribute 必须在 :min 到 :max 项之间' , ], 'boolean' => ':attribute字符必须是 true 或false, 1 或 0 ' , 'confirmed' => ':attribute 二次确认不匹配' , 'date' => ':attribute 必须是一个合法的日期' , 'date_format' => ':attribute 与给定的格式 :format 不符合' , 'different' => ':attribute 必须不同于 :other' , 'digits' => ':attribute必须是 :digits 位.' , 'digits_between' => ':attribute 必须在 :min 和 :max 位之间' , 'dimensions' => ':attribute具有无效的图片尺寸' , 'distinct' => ':attribute字段具有重复值' , 'email' => ':attribute必须是一个合法的电子邮件地址' , 'exists' => '选定的 :attribute 是无效的.' , 'file' => ':attribute必须是一个文件' , 'filled' => ':attribute的字段是必填的' , 'image' => ':attribute必须是 jpeg, png, bmp 或者 gif 格式的图片' , 'in' => '选定的 :attribute 是无效的' , 'in_array' => ':attribute 字段不存在于 :other' , 'integer' => ':attribute 必须是个整数' , 'ip' => ':attribute必须是一个合法的 IP 地址。' , 'json' => ':attribute必须是一个合法的 JSON 字符串' , 'max' => [ 'numeric' => ':attribute 的最大长度为 :max 位' , 'file' => ':attribute 的最大为 :max' , 'string' => ':attribute 的最大长度为 :max 字符' , 'array' => ':attribute 的最大个数为 :max 个.' , ], 'mimes' => ':attribute 的文件类型必须是 :values' , 'min' => [ 'numeric' => ':attribute 的最小长度为 :min 位' , 'file' => ':attribute 大小至少为 :min KB' , 'string' => ':attribute 的最小长度为 :min 字符' , 'array' => ':attribute 至少有 :min 项' , ], 'not_in' => '选定的 :attribute 是无效的' , 'numeric' => ':attribute 必须是数字' , 'present' => ':attribute 字段必须存在' , 'regex' => ':attribute 格式是无效的' , 'required' => ':attribute 字段是必须的' , 'required_if' => ':attribute 字段是必须的当 :other 是 :value' , 'required_unless' => ':attribute 字段是必须的,除非 :other 是在 :values 中' , 'required_with' => ':attribute 字段是必须的当 :values 是存在的' , 'required_with_all' => ':attribute 字段是必须的当 :values 是存在的' , 'required_without' => ':attribute 字段是必须的当 :values 是不存在的' , 'required_without_all' => ':attribute 字段是必须的当 没有一个 :values 是存在的' , 'same' => ':attribute和:other必须匹配' , 'size' => [ 'numeric' => ':attribute 必须是 :size 位' , 'file' => ':attribute 必须是 :size KB' , 'string' => ':attribute 必须是 :size 个字符' , 'array' => ':attribute 必须包括 :size 项' , ], 'string' => ':attribute 必须是一个字符串' , 'timezone' => ':attribute 必须是个有效的时区.' , 'unique' => ':attribute 已存在' , 'url' => ':attribute 无效的格式' , /* |-------------------------------------------------------------------------- | Custom Validation Language Lines |-------------------------------------------------------------------------- | | Here you may specify custom validation messages for attributes using the | convention "attribute.rule" to name the lines. This makes it quick to | specify a specific custom language line for a given attribute rule. | */ 'custom' => [ 'attribute-name' => [ 'rule-name' => 'custom-message' , ], ], /* |-------------------------------------------------------------------------- | Custom Validation Attributes |-------------------------------------------------------------------------- | | The following language lines are used to swap attribute place-holders | with something more reader friendly such as E-Mail Address instead | of "email". This simply helps us make messages a little cleaner. | */ 'attributes' => [ // 'name' => '名字', // 'age' => '年龄', ], ]; |
以上这篇Laravel中validation验证 返回中文提示 全局设置的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持开心学习网。
原文链接:https://learnku.com/articles/5840/validation-validation-in-laravel-returns-chinese-prompt
您可能感兴趣
- laravel队列是如何触发的(laravel使用Faker数据填充的实现方法)
- laravel自定义实现服务提供者(laravel http 自定义公共验证和响应的方法)
- laravel服务提供者应用场景(Laravel如何创建服务器提供者实例代码)
- laravel 后台管理框架(laravel-admin 管理平台获取当前登陆用户信息的例子)
- laravel框架学习心得教程(Laravel5.7 Eloquent ORM快速入门详解)
- laravel自动分解大任务(Laravel如何实现自动加载类)
- laravel查询构建器原理和使用(阿里对象存储OSS在laravel框架中的使用方法)
- laravel数据库切换(实现laravel 插入操作日志到数据库的方法)
- laravel数据库配置(Laravel如何同时连接多个数据库详解)
- laravel定时脚本(laravel实现按时间日期进行分组统计方法示例)
- laravel接口规范(Laravel5.5 手动分页和自定义分页样式的简单实现)
- laravel后台管理(关于laravel后台模板laravel-admin select框的使用详解)
- laravel框架知识点(Laravel 不同生产环境服务器的判断实践)
- laravel模型获取表名(Laravel 对某一列进行筛选然后求和sum的例子)
- laravel模型怎么使用(laravel5.1框架model类查询的实现方法)
- laravel数据绑定(laravel-admin表单提交隐藏一些数据,回调时获取数据的方法)
- 岳云鹏跟凤凰传奇谈心,说出了人生中最重要的三个人,这才成功(岳云鹏跟凤凰传奇谈心)
- 爱情可以当饭吃吗(爱情能当饭吃吗)
- Top 3 JSHS《运动与健康科学 英文 》跻身SCI体育学期刊世界前三(Top3JSHS运动与健康科学)
- 体坛传媒LOGO全新升级,多元发展迈出坚实步伐(体坛传媒LOGO全新升级)
- 超撩人治愈的绝美水彩,原来出自她之手 一笔一画令无数人沉醉(超撩人治愈的绝美水彩)
- 新手的勾线(新手的勾线)
热门推荐
- sql server 过期激活(SQL Server评估期已过问题的解决方法)
- python编程ai人工智能(AI领域都在用Python即将被淘汰?网友预测未来的编程语言不会是TA)
- 纯css写三角形(老生常谈 使用 CSS 实现三角形的技巧多种方法)
- docker配置https访问方式(docker 中配置 eureka的方法)
- mysql中自增字段类型(MySQL数字类型自增的坑)
- docker只有localhost可用(浅谈Docker如何自定义host文件)
- django连接web实现登录功能(解决django前后端分离csrf验证的问题)
- 如何减少用户操作网站时的出错率
- 查sqlserver锁表语句(Sql Server如何查看被锁的表及解锁的方法)
- Asp.net导出Excel乱码
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9