Fortify:Target class [password.confirm] 不存在

Fortify:Target class [password.confirm] does not exist

我正在实施强化“双因素身份验证”作为对路由进行 POST 调用的第一步:/user/two-factor-authentication

我创建了以下表格:

@if (session('status') != 'two-factor-authentication-enabled')
    <div class="mb-4 font-medium text-sm text-green-600">
        Two factor authentication has been enabled.
        <form method="POST" action="{{route('two-factor.enable')}}">
            @csrf

            <button>
                Submit
            </button>
        </form>

    </div>
@endif

按下按钮后出现以下错误:Illuminate \ Contracts \ Container \ BindingResolutionException 目标 class [password.confirm] 不存在。

试试这个: 在你的 app/http/kernel.php 添加以下命令

'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class