当前位置:网站首页>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
边栏推荐
- MySQL面试题讲解之如何设置Hash索引
- Understanding of fileprovider path configuration strategy
- 26. Delete duplicates in ordered array
- 学习 Go 语言 0x02:对切片 Slice 的理解
- Visual Road (XII) detailed explanation of collection class
- MySQL数据库10秒内插入百万条数据的实现
- 如何使用JDBC CallableStatement.wasNull()方法调用来查看最后一个OUT参数的值是否为 SQL NULL
- Detailed introduction to paging exploration of MySQL index optimization
- Excel · VBA array bubble sorting function
- Data analysis learning (I) data analysis and numpy Foundation
猜你喜欢
Visualization Road (11) detailed explanation of Matplotlib color
Google Earth Engine(GEE)——将原始影像进行升尺度计算(以海南市为例)
Visual Road (XII) detailed explanation of collection class
Upgrade the functions available for cpolar intranet penetration
After the MySQL router is reinstalled, it reconnects to the cluster for boot - a problem that has been configured in this host before
得物技术网络优化-CDN资源请求优化实践
采用百度飞桨EasyDL完成指定目标识别
About the three commonly used auxiliary classes of JUC
R-drop: a more powerful dropout regularization method
比深度学习更值得信赖的模型ART
随机推荐
JDBC – PreparedStatement – 如何设置 Null 值?
学习 Go 语言 0x02:对切片 Slice 的理解
Cumcm 2021 - B: préparation d'oléfines C4 par couplage éthanol (2)
Cygwin 中的 rename 用法
MySQL sorting feature details
26. 删除有序数组中的重复项
活动进行时! 点击链接加入直播间参与“AI真的能节能吗?”的讨论吧!
Visual Road (XII) detailed explanation of collection class
我的创作纪念日
How to use JDBC callablestatement The wasnull () method is called to check whether the value of the last out parameter is SQL null
Using El popconfirm and El backtop does not take effect
学习 Go 语言 0x06:《Go 语言之旅》中 斐波纳契闭包 练习题代码
Visual common drawing (IV) histogram
Visualization Road (10) detailed explanation of segmentation canvas function
《Neo4j权威指南》简介,求伯君、周鸿袆、胡晓峰、周涛等大咖隆重推荐
About the three commonly used auxiliary classes of JUC
On lambda powertools typescript
面向全球市场,PlatoFarm今日登录HUOBI等全球四大平台
卷积层和池化层总结
Mysql8. 0 installation guide