我有一个表单请求类来验证我的数据,并且我正在使用messages()
方法返回自定义的验证错误信息,如下所示:
public function messages()
{
return [
'name.valid_name' => 'The name is incorrect, please see the <a href="'.route('naming_conventions').'">Naming Conventions</a> page for instructions on naming.'
];
}
正如您所看到的,我希望在错误消息中输出超链接以帮助用户。 然而,当错误消息被输出时,所有HTML标记都被转换为实体,因此实际输出的是:
The name is incorrect, please see the <a href="http://local.website.com/naming-conventions">Naming Conventions</a> page for instructions on naming.
我该如何在错误信息中输出HTML?
如何在错误信息中输出HTML?