当前位置:网站首页>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 interview questions explain how to set hash index
- mysql创建存储过程及函数详解
- Visual Road (XII) detailed explanation of collection class
- 比深度学习更值得信赖的模型ART
- Difference between pregnancy box and delivery box
- Visualization Road (10) detailed explanation of segmentation canvas function
- Excel · VBA array bubble sorting function
- Visual common drawing (I) stacking diagram
- Google Earth Engine(GEE)——将原始影像进行升尺度计算(以海南市为例)
- Constraintlayout layout
猜你喜欢
Mysql8.0安装指南
学习 Go 语言 0x04:《Go 语言之旅》中切片的练习题代码
比深度学习更值得信赖的模型ART
Google Earth Engine(GEE)——将原始影像进行升尺度计算(以海南市为例)
MIT: label every pixel in the world with unsupervised! Humans: no more 800 hours for an hour of video
Jupyter Lab 十大高生产力插件
初探 Lambda Powertools TypeScript
MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题
PDMS软光刻加工过程
MIT:用无监督为世界上每个像素都打上标签!人类:再也不用为1小时视频花800个小时了
随机推荐
精彩回顾|「源」来如此 第六期 - 开源经济与产业投资
Implementation of inserting millions of data into MySQL database in 10 seconds
学习 Go 语言 0x06:《Go 语言之旅》中 斐波纳契闭包 练习题代码
Excel · VBA custom function to obtain multiple cell values
小程序 支付
Use of SVN:
26. 删除有序数组中的重复项
FileProvider 路径配置策略的理解
活动进行时! 点击链接加入直播间参与“AI真的能节能吗?”的讨论吧!
Oracle连通性测试小工具
Typora operation skill description (I) md
详解MySQL中timestamp和datetime时区问题导致做DTS遇到的坑
Visualized common drawing (II) line chart
我的创作纪念日
Interprocess communication -- message queue
GO接口使用
web三大组件(Servlet,Filter,Listener)
After the MySQL router is reinstalled, it reconnects to the cluster for boot - a problem that has been configured in this host before
妊娠箱和分娩箱的区别
Mba-day5 Mathematics - application problems - engineering problems