“密码重置令牌无效"的覆盖错误文本Laravel [英] Overwrite Error text for 'The password reset token is invalid' Laravel

查看:84
本文介绍了“密码重置令牌无效"的覆盖错误文本Laravel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果密码重置令牌已过期,我需要覆盖错误消息.但默认情况下,它显示密码重置令牌无效",但我需要使用其他文本.我使用Laravel 5.6

I need to overwrite error message if password reset token was expired. Bu default it shows 'The password reset token is invalid' but I need different text instead. I work with Laravel 5.6

我试图找到方法,但是在这里或在官方文档上都没有找到任何信息.

I've tried to find how to do it, but no any info here or on the official documentation found.

非常感谢您的帮助或技巧,

Help or tips where to read about are very appreciated!

推荐答案

您可以在 resources/lang/zh-cn/passwords.php 中的文件中找到翻译字符串.

You can find the translation string in the file located in resources/lang/en/passwords.php.

这还确保您可以将此字符串转换为您使用的其他语言.

This also ensures that you can translate this string for other languages you use.

<?php
return [
    /*
    |--------------------------------------------------------------------------
    | Password Reset Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are the default lines which match reasons
    | that are given by the password broker for a password update attempt
    | has failed, such as for an invalid token or invalid new password.
    |
    */
    'reset' => 'Your password has been reset!',
    'sent' => 'We have e-mailed your password reset link!',
    'token' => 'This password reset token is invalid.',
    'user' => "We can't find a user with that e-mail address.",

此文件

这篇关于“密码重置令牌无效"的覆盖错误文本Laravel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆