当前位置:网站首页>Laravel admin form validation
Laravel admin form validation
2022-04-23 11:18:00 【Scholar and】
$form->text("name", " full name ")
->creationRules('required|unique:table', ['required' => ' Name cannot be empty ','unique' => ' The name cannot be repeated '])
->updateRules('required|unique:table,name,{
{id}}', ['required' => ' Name cannot be empty ','unique' => ' The name cannot be repeated '])
->required();
//table: Table name
//creationRules: Verify when adding
//updateRules: Verify while editing ,table Table exclusion conditions id For the current id The data of ,name Can't repeat
//{
{id}}: Just write as usual
//required(): The required fields are marked with a red star
版权声明
本文为[Scholar and]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231116051542.html
边栏推荐
- Redis optimization series (II) redis master-slave principle and master-slave common configuration
- Visual common drawing (V) scatter diagram
- Mysql8.0安装指南
- 语雀文档编辑器将开源:始于但不止于Markdown
- Microsoft Access database using PHP PDO ODBC sample
- Get things technology network optimization - CDN resource request Optimization Practice
- My creation anniversary
- JDBC – PreparedStatement – 如何设置 Null 值?
- 进程间通信 -- 消息队列
- Implementation of partition table of existing data table by MySQL
猜你喜欢
一道有趣的阿里面试题
Learn go language 0x04: Code of exercises sliced in go language journey
Excel·VBA自定义函数获取单元格多数值
Using Baidu PaddlePaddle EasyDL to accomplish specified target recognition
Usage of rename in cygwin
年度最尴尬的社死瞬间,是Siri给的
Promise详解
MySQL Router重装后重新连接集群进行引导出现的——此主机中之前已配置过的问题
vm设置静态虚拟机
Excel · VBA custom function to obtain multiple cell values
随机推荐
oh-my-lotto
初探 Lambda Powertools TypeScript
laravel-admin表单验证
Google Earth Engine(GEE)——将原始影像进行升尺度计算(以海南市为例)
Structure of C language (Advanced)
Pytorch neural network trainer
CUMCM 2021-B:乙醇偶合制备C4烯烃(2)
Constraintlayout layout
MySQL8.0升级的踩坑历险记
Mysql database transaction example tutorial
qt5.8 64 位静态库中想使用sqlite但静态库没有编译支持库的方法
Mysql排序的特性详情
Learn go language 0x04: Code of exercises sliced in go language journey
得物技术网络优化-CDN资源请求优化实践
Using El popconfirm and El backtop does not take effect
Mba-day5 Mathematics - application problems - engineering problems
Mba-day6 logic - hypothetical reasoning exercises
Learning go language 0x02: understanding slice
Learning go language 0x08: practice using error in go language journey
Detailed explanation of typora Grammar (I)