Search code examples
laravelauthenticationfortify

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


I am implementing with fortify the "two factor authentication" as the first step to make a POST call to the route: /user/two-factor-authentication

I created the following form:

@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

After pressing the button I get the following error: Illuminate \ Contracts \ Container \ BindingResolutionException Target class [password.confirm] does not exist.


Solution

  • Try this: In your app/http/kernel.php add the following command

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