如果注冊(cè)后的第一個(gè)郵件沒(méi)有發(fā)送,我有一個(gè)簡(jiǎn)單的功能,點(diǎn)擊即可向用戶發(fā)送電子郵件。但是當(dāng)我單擊該按鈕時(shí),它沒(méi)有任何反應(yīng),而是將我?guī)У街黜?yè)。重發(fā)函數(shù):protected function resend() { $user = Account::where('email', Auth::user()->email)->first(); $user->verifyToken = Str::random(40); $user->save(); $this->sendEmail($user); return redirect(route('verifyEmail'))->with('user',$user)->with('success', 'A link has been sent to your email'); }Route::post('/resend/email', 'Auth\RegisterController@resend')->name('resendEmail');html:<form action=" {!! route('resendEmail') !!}" method="POST"> @csrf <button class="btn btn-default" type="submit" value="Submit">Resend Verification Link</button></form>通過(guò)添加到構(gòu)造函數(shù)修復(fù)了中間件問(wèn)題: $this->middleware('auth', ['except' => ['resendEmail']]);
重新發(fā)送電子郵件的功能將我?guī)У街黜?yè),并且在給定的功能中不執(zhí)行任何操作 - Laravel
墨色風(fēng)雨
2023-08-06 14:54:49