I want to resend verification email. But I got an error Call to a member function hasVerifiedEmail() on null.
RegisterController.php
protected function registered(Request $request)
{
$this->guard()->logout();
$msg = 'We sent you an activation code. Check your email and click on the link to verify. If you did not receive the email, <a href=" ' .route('verification.resend'). ' ">click here</a> to request another';
$request->session()->flash('success', $msg);
return redirect('/register');
}
VerificationController
public function __construct()
{
//$this->middleware('auth');
/*$this->middleware(function($request, Closure $next) {
if(auth()->check())
{
return $next($request);
}
return redirect()->route('register')->with('success', "Link verivication has been sent!");
});*/
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
Web.php
Route::get('/user/verify/{token}', 'Auth\RegisterController@verifyUser');
//Route::get('register/confirm/resend','Auth\RegisterController@resendVerification');
Route::get('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire