本文整理汇总了PHP中app\User::whereConfirmationCode方法的典型用法代码示例。如果您正苦于以下问题:PHP User::whereConfirmationCode方法的具体用法?PHP User::whereConfirmationCode怎么用?PHP User::whereConfirmationCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\User
的用法示例。
在下文中一共展示了User::whereConfirmationCode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getConfirmation
public function getConfirmation($code)
{
// dd($code);
if ($user = \App\User::whereConfirmationCode($code)->first()) {
$user->update(['confirmed' => 1]);
$this->auth->login($user);
return redirect()->intended($this->redirectPath())->with('message', trans('login.confirmation.confirmed'));
}
// return view('auth.confirmation_error');
}
示例2: confirmEmail
public function confirmEmail($token)
{
$result = User::where('confirmation_code', '=', $token)->get();
if (!$result->isEmpty()) {
User::whereConfirmationCode($token)->firstOrFail()->confirmEmail();
flash()->success('Your account was successfully registered.');
return redirect('/');
} else {
flash()->error('That code was incorrect, please make sure you follow the link in the verification email.');
return redirect('/');
}
}
示例3: confirm
public function confirm($confirmationcode)
{
$user = User::whereConfirmationCode($confirmationcode)->first();
if (!$user) {
return view("auth.invalid");
} else {
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
return view("auth.confirmed");
}
}
示例4: confirm
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
abort(404);
}
$user = \App\User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
abort(404);
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
Session::flash('success', 'alt');
return redirect('auth/login');
}
示例5: confirm
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
return $confirmation_code;
}
$user = User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
return view("doverification")->with(['message' => 'you are already registered user please login', "button_message" => 'Login', 'button_url' => '/home']);
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
return view('doverification')->with(['message' => 'your account has been verifed !!!', 'button_message' => 'Login', 'button_url' => '/home']);
// return Redirect::route('login_path');
}
示例6: confirm
/**
* Confirm a new user from email
* @param $confirmation_code
* @return $this|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
return redirect('auth/login')->withErrors('You lose a confirmation code!');
}
$user = User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
return redirect('auth/login')->withErrors('Wrong confirmation code!');
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
Flash::message('You have successfully verified your account.');
return redirect('auth/login');
}
示例7: confirm
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
return "error";
}
$user = User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
return "error";
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
$this->dispatch(new SendConfirmationEmail($user));
return "confirmed";
}
示例8: getVerify
/**
* Verify the user's account, via confirmation link.
*
* @param $confirmation_code
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
* @throws InvalidConfirmationCodeException
*/
public function getVerify($confirmation_code = null)
{
if (!$confirmation_code) {
throw new InvalidConfirmationCodeException(trans('register-page.flash-2'));
}
$user = User::whereConfirmationCode($confirmation_code);
if (!$user instanceof User) {
throw new InvalidConfirmationCodeException(trans('register-page.flash-3'));
}
$user->confirmation_code = null;
$user->active = 1;
$user->save();
Session::flash('flash_message', trans('register-page.flash-4'));
return redirect('/');
}
示例9: confirm
public function confirm($codigo)
{
if (!$codigo) {
throw new InvalidConfirmationCodeException();
}
$user = User::whereConfirmationCode($codigo)->first();
if (!$user) {
throw new InvalidConfirmationCodeException();
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
\Session::flash('flash_message', 'Conta Verificada com Sucesso!');
return redirect('home');
//Ainda nao cadastrou, solicitar o cadastro
}
示例10: confirm
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
return Redirect('auth/login');
//throw new InvalidConfirmationCodeException;
}
$user = User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
return Redirect('/');
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
Flash::message('You have successfully verified your account.');
return Redirect('home');
}
示例11: confirm
public function confirm($email, $confirmation_code)
{
if (!$confirmation_code) {
// throw new InvalidConfirmationCodeException;
}
$user = \App\User::whereConfirmationCode($confirmation_code)->whereEmail($email)->first();
if (!$user) {
// throw new InvalidConfirmationCodeException;
// или подтвержден или нет такого пользователя или не правильный код
return \Redirect::to('login');
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
\Session::flash('verify_message', 'You successfuly confirmed');
return \Redirect::to('login');
}
示例12: confirm
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
throw new InvalidConfirmationCodeException();
}
$user = User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
echo "error ";
exit;
}
$user->confirmed = 1;
//$user->confirmation_code = null;
$user->save();
flash('Votre compte a été confirmé avec succès, vous êtes à présent connecté.');
Auth::login($user);
return redirect('/home');
}
示例13: confirm
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
throw new InvalidConfirmationCodeException();
}
$user = User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
//throw new InvalidConfirmationCodeException;
}
$user->activation = 1;
$user->confirmation_code = null;
$user->save();
\Session::flash('status', 'You have been successfully verified!');
return redirect('login');
}
示例14: getUserByCode
/**
* Get user by given confirmation code.
*
* @param string $code
*
* @return \App\User
*/
public function getUserByCode($code)
{
return User::whereConfirmationCode($code)->whereConfirmed(false)->firstOrFail();
}
示例15: confirm
/**
* @param $confirmation_code
* @throws InvalidConfirmationCodeException if the confirmation_code or user are not found
* @return mixed
*/
public function confirm($confirmation_code)
{
if (!$confirmation_code) {
throw new InvalidConfirmationCodeException();
//@todo setup Exception
}
$user = User::whereConfirmationCode($confirmation_code)->first();
if (!$user) {
throw new InvalidConfirmationCodeException();
//@todo setup Exception
}
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
// Flash::message('You have successfully verified your account.'); //@todo flash messaging untested, commenting out for now
$this->sendWelcomeEmail($user);
$this->auth->login($user);
return redirect('home');
}