php - “/”laravel消息验证问题
问题描述
我在 laravel 验证中返回正确消息时遇到问题。我的代码:
public function messages(): array
{
return [
'regex' => "Field :attribute is must contain alphanumeric characters . : / - , or space",
];
}
回复:
"Field comment is must contain alphanumeric characters . : \/ - , or space"
如何在消息中返回“/”?
解决方案
尚不确定该消息,但您可以使用HTML entity for slash
它来解决此问题,因为它会/
在浏览器上正确显示。
<?php
public function messages(): array{
return [
'regex' => "Field :attribute is must contain alphanumeric characters . : / - , or space",
];
}
推荐阅读
- python - 删除嵌套列表中字符串值中的撇号
- ruby-on-rails - Ruby on Rails - 从某些路由中排除单个域
- r - 链接到弹出窗口中的图像(R 传单)
- jmeter - 如何为 JMeter 测试计划定义不同的变量集
- c - 如何在不重复除法的情况下判断一个数是否为素数
- java - 在 Android Studio 中保存视图中的视频
- r - 关于应用 K 折交叉验证时 R 中的 Caret 包
- javascript - 这个 API 端点如何验证请求是否合法?
- google-chrome-devtools - 在 Chrome 中调试 WebAssembly
- cordova - 删除离子科尔多瓦插件的正确方法