【问题标题】:Laravel 8: how to translate two factor authentication default messageLaravel 8:如何翻译两因素身份验证默认消息
【发布时间】:2021-04-27 19:54:09
【问题描述】:

我正在使用 Laravel Fortify,我想翻译这个默认消息怎么做?

提供的两因素验证码无效。

我在这个地址中找到了这条消息,但这是来源,我无法更改它

src/Http/Responses/FailedTwoFactorLoginResponse.php

public function toResponse($request)
{
    $message = __('The provided two factor authentication code was invalid.');

    if ($request->wantsJson()) {
        throw ValidationException::withMessages([
            'code' => [$message],
        ]);
    }

    return redirect()->route('login')->withErrors(['email' => $message]);
}

【问题讨论】:

    标签: laravel-8 fortify


    【解决方案1】:

    您是否安装和开发了本地化?似乎该消息只需要语言环境。应用语言的东西

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-09
      • 1970-01-01
      • 2022-07-25
      • 1970-01-01
      • 1970-01-01
      • 2019-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多