Laravel表单验证中所有的占位符可以在哪里查询到
在laravel文档中,自定义错误消息列出了几个占位符,如下:
$messages = [
'same' => 'The :attribute and :other must match.',
'size' => 'The :attribute must be exactly :size.',
'between' => 'The :attribute value :input is not between :min - :max.',
'in' => 'The :attribute must be one of the following types: :values',
];
请问其他规则的占位符可以在哪里查询呢?官方文档中文和英文都没有写。
我找到一篇laravel5验证规则的占位符,不过8和5的占位符名称有不少改变了,想问问在laravel的源码中能否查到占位符呢?文件在什么位置?
关于 LearnKu
官方文档里面似乎没有提到,不过在较新版的 Laravel 中,相应的替换都在 framework/ReplacesAttributes.php at 9.x · laravel/framework 这个 Trait 里面,旧的在
\Illuminate\Validation\Validator这个类里面,以 replace 开头的方法。具体调用是从这里来的