我的验证数据的代码如下: p>
public function register(请求$ request)
{
// echo'< pre>'; print_r($ request-> all()); echo'< / pre>'; die();
$ this - >验证($ request,[
'电子邮件'=>'必需',
'密码'=>'必需',
'data_cache.dataCache.id'=>'必需|数字'
'data_cache.dataCache.quantity'=>'required | numeric'
]);
}
code> pre>
echo'的结果 < pre>'; print_r($ request-> all()); echo'< / pre>'; die(); code>,如下所示: p>
< code> Array
(
[data_cache] =&gt; {“dataCache”:{“id”:112,“quantity”:1,“information”:“stamford bridge”,“request_date”:“15-08- 2017 02:30:00“},”已过期“:”2017-08-14T16:30:26.272Z“}
[email] =&gt; chelsea@gmail.com
[密码] =&gt; 87654321
)
code> pre>
data_cache是json数据 p>
在视图刀片上,我添加它以显示消息验证: p>
@if($ errors-&gt; has('data_cache'))
&lt; span class =“help-block”&gt;
&lt; strong&gt; {{$ errors- &gt; first('data_cache')}}&lt; / strong&gt;
&lt; / span&gt;
@ endif
code> pre>
如果代码已执行,则有 没有显示消息验证 p>
似乎验证json数据仍然存在错误 p>
我该如何正确执行? p>
div >