【发布时间】:2021-06-24 21:02:23
【问题描述】:
删除电子邮件字段并添加用户名字段很容易。 (在使用登录视图之后)它使用用户名字段进行身份验证就好了,我做了同样的事情。
\resources\views\auth\reset-password.blade.php ```
<form method="POST" action="{{ route('password.update') }}">
@csrf
<input type="hidden" name="token" value="{{ $request->route('token') }}">
<div class="block">
<x-jet-label for="username" value="{{ __('User name') }}" />
<x-jet-input id="username" class="block mt-1 w-full" type="text" name="username" :value="old('username')" required autofocus autocomplete="username" />
</div>
{{-- <div class="block">
<x-jet-label for="email" value="{{ __('Email') }}" />
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email', $request->email)" required autofocus />
</div> --}}
<div class="mt-4">
<x-jet-label for="password" value="{{ __('Password') }}" />
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required autocomplete="new-password" />
</div>
<div class="mt-4">
<x-jet-label for="password_confirmation" value="{{ __('Confirm Password') }}" />
<x-jet-input id="password_confirmation" class="block mt-1 w-full" type="password" name="password_confirmation" required autocomplete="new-password" />
</div>
<div class="flex items-center justify-end mt-4">
<x-jet-button>
{{ __('Reset Password') }}
</x-jet-button>
</div>
</form>
但是当我尝试使用它时,我得到:
Whoops! Something went wrong.
The email field is required.
我无法弄清楚输入的验证位置,以便我进行所需的更改以期望用户名代替电子邮件地址。
【问题讨论】:
标签: authentication laravel-8 laravel-livewire change-password jetstream