当前位置:网站首页>laravel-admin表单验证
laravel-admin表单验证
2022-04-23 11:16:00 【书生及第】
$form->text("name", "姓名")
->creationRules('required|unique:table', ['required' => '姓名不能为空','unique' => '姓名不能重复'])
->updateRules('required|unique:table,name,{
{id}}', ['required' => '姓名不能为空','unique' => '姓名不能重复'])
->required();
//table:表名
//creationRules:新增时验证
//updateRules:编辑时验证,table表排除条件id为当前id的数据,name不能重复
//{
{id}}:照常写即可
//required():必填字段加红星标识
版权声明
本文为[书生及第]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_38989173/article/details/124347152
边栏推荐
- 进程间通信 -- 消息队列
- CUMCM 2021-b: preparation of C4 olefins by ethanol coupling (2)
- MySQL面试题讲解之如何设置Hash索引
- 学习网站资料
- MySQL8.0升级的踩坑历险记
- Cygwin 中的 rename 用法
- @Valid, @ validated learning notes
- Excel·VBA自定义函数获取单元格多数值
- Implementation of inserting millions of data into MySQL database in 10 seconds
- 《Neo4j权威指南》简介,求伯君、周鸿袆、胡晓峰、周涛等大咖隆重推荐
猜你喜欢

Excel · VBA custom function to obtain multiple cell values

得物技术网络优化-CDN资源请求优化实践

CUMCM 2021-B:乙醇偶合制备C4烯烃(2)

Visual common drawing (IV) histogram

Use of SVN:

赛微微电科创板上市破发:跌幅达26% 公司市值44亿

Visualization Road (10) detailed explanation of segmentation canvas function

第六站神京门户-------手机号码的转换

Visualized common drawing (II) line chart

一道有趣的阿里面试题
随机推荐
Typora operation skill description (I)
FileProvider 路径配置策略的理解
关于JUC三大常用辅助类
MBA-day5数学-应用题-工程问题
年度最尴尬的社死瞬间,是Siri给的
MySQL8.0升级的踩坑历险记
Analysis on the characteristics of the official game economic model launched by platoffarm
Visual common drawing (III) area map
Mba-day5 Mathematics - application problems - engineering problems
MySQL interview questions explain how to set hash index
Mysql database transaction example tutorial
期货开户哪个公司好?安全靠谱的期货公司谁能推荐几家?
PlatoFarm推出正式版游戏经济模型的特点分析
我的创作纪念日
Learning website materials
Excel·VBA数组冒泡排序函数
Mba-day6 logic - hypothetical reasoning exercises
mysql分表之后如何平滑上线详解
Introduction to neo4j authoritative guide, recommended by Qiu Bojun, Zhou Hongxiang, Hu Xiaofeng, Zhou Tao and other celebrities
Get things technology network optimization - CDN resource request Optimization Practice