当前位置: 首页>>代码示例>>PHP>>正文


PHP User::whereToken方法代码示例

本文整理汇总了PHP中app\User::whereToken方法的典型用法代码示例。如果您正苦于以下问题:PHP User::whereToken方法的具体用法?PHP User::whereToken怎么用?PHP User::whereToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\User的用法示例。


在下文中一共展示了User::whereToken方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: confirmEmail

 public function confirmEmail($token)
 {
     User::whereToken($token)->firstOrFail()->confirmEmail();
     alert()->success('Thanks you for comfirmation');
     //session()->flash('message', 'Thanks you for comfirmation. ') ;
     return redirect('login');
 }
开发者ID:paihz,项目名称:instaX-project,代码行数:7,代码来源:RegistrationController.php

示例2: confirmEmail

 /**
  * Confirm a user's email
  *
  * @param $token
  */
 public function confirmEmail($token)
 {
     $user = User::whereToken($token)->firstOrFail();
     $user->verified = true;
     $user->token = null;
     $user->save();
 }
开发者ID:johnleider,项目名称:saferoll,代码行数:12,代码来源:AuthController.php

示例3: getRegisterConfirm

 /**
  * Handle an email confirmation request for the application.
  *
  * @param $token
  * @return \Illuminate\Http\RedirectResponse
  */
 public function getRegisterConfirm($token)
 {
     $user = User::whereToken($token)->firstOrFail();
     $user->verified = true;
     $user->token = null;
     $user->save();
     return redirect()->route('account')->with('alert-success', 'Your e-mail address was successfully confirmed. You can now login to your account.');
 }
开发者ID:excalibur1028,项目名称:thesis,代码行数:14,代码来源:AuthController.php

示例4: confirmEmail

 /**
  * @param $token
  * @return Redirect
  */
 public function confirmEmail($token)
 {
     $role = Role::where('id', 3)->first();
     $user = User::whereToken($token)->firstOrFail()->confirmEmail();
     \DB::table('role_user')->insert(['role_id' => $role->id, 'user_id' => $user->id]);
     Auth::login($user);
     // $user->assignRole($role);
     return redirect()->to('dashboard');
 }
开发者ID:RobbieBakker,项目名称:laravelstuff,代码行数:13,代码来源:RegistrationController.php

示例5: confirm

 public function confirm($token)
 {
     $user = User::whereToken($token)->first();
     $user->verified = true;
     $user->token = null;
     $user->save();
     session()->flash('message', 'You are Now Verified Please Login');
     return redirect('login');
 }
开发者ID:nirajanpoudel,项目名称:hrms,代码行数:9,代码来源:RegisterController.php

示例6: confirmEmail

 /**
  * Confirm a user's email address.
  *
  * @param  string $token
  * @return mixed
  */
 public function confirmEmail(Request $request, $token)
 {
     // find user based on the verif token
     $user = User::whereToken($token)->firstOrFail();
     // confirm and login if not logged already
     $user->confirmEmail();
     if (Auth::guest()) {
         Auth::login($user);
         //TODO security implication of this
     }
     flash()->info(trans('messages.you_have_verified_your_email'));
     return redirect('/');
 }
开发者ID:philippejadin,项目名称:Mobilizator,代码行数:19,代码来源:AuthController.php

示例7: confirmEmail

 public function confirmEmail($token)
 {
     $user = User::whereToken($token)->first();
     if ($user != null) {
         $user->verified = true;
         $user->token = null;
         $user->save();
         \Auth::loginUsingId($user->id);
         session()->flash('message', 'Your email is now confirmed and your account activated. Please update your details');
         return redirect('/myAccount');
     }
     return redirect('/register')->withErrors("Registration token not found");
 }
开发者ID:abada,项目名称:SettleUp-Laravel,代码行数:13,代码来源:RegistrationController.php

示例8: index

 public function index(Request $request)
 {
     $userToken = $request->get('user_token', '');
     if (empty($userToken)) {
         return response()->json(['status' => 'error', 'message' => 'user_token necesario']);
     }
     $user = User::whereToken($userToken)->first();
     if (!is_null($user)) {
         $orders = $user->orders()->whereStatus('success')->select('id', \DB::raw('CONCAT("PED", LPAD(id, 10, 0)) as number'), 'date_time')->orderBy('id', 'desc')->get();
         return response()->json(['status' => 'success', 'message' => '', 'data' => $orders]);
     } else {
         return response()->json(['status' => 'error', 'message' => 'no se encontró usuario con el token especificado']);
     }
 }
开发者ID:andreebit,项目名称:tickets,代码行数:14,代码来源:OrderController.php

示例9: verifyEmail

 /**
  * Verify user's email address.
  *
  * @param $token
  * @return \Illuminate\Http\RedirectResponse
  */
 public function verifyEmail($token)
 {
     $user = User::whereToken($token)->first();
     if ($user) {
         $user->confirmEmail();
         flash()->overlay("Email verified", "You successfully verified your email address {$user->email}.", "success");
         Auth::login($user, $remember = false);
     } else {
         flash()->overlay("Error", "This email address has been already confirmed.", "error");
     }
     return redirect('/');
 }
开发者ID:numencode,项目名称:laravel-authentication,代码行数:18,代码来源:AuthController.php

示例10: confirmEmail

 public function confirmEmail($token)
 {
     $user = User::whereToken($token)->firstOrFail()->confirmEmail();
     flash('You are now confirmed. Please login.');
     return redirect('login');
 }
开发者ID:amritms,项目名称:laravel_admin_login,代码行数:6,代码来源:RegistrationController.php

示例11: confirmEmail

 public function confirmEmail($token)
 {
     try {
         $user = User::whereToken($token)->firstOrFail();
         $user->confirmEmail();
         session()->flash('message', 'Thank you for confirming your email.');
         $this->mailer->sendEmailHasBeenConfirmed($user);
     } catch (ModelNotFoundException $e) {
         session()->flash('message', 'This link has already been used or is invalid.');
     }
     return redirect('login');
 }
开发者ID:getacked,项目名称:project,代码行数:12,代码来源:AuthController.php

示例12: confirmEmail

 public function confirmEmail($token)
 {
     $user = User::whereToken($token)->firstOrFail();
     $user->verified = true;
     $user->token = null;
     $user->save();
     return view('prac.email_confirmation');
 }
开发者ID:Riger004,项目名称:thermal,代码行数:8,代码来源:testController.php

示例13: getByToken

 public function getByToken()
 {
     return User::whereToken(session('user.token'))->first();
 }
开发者ID:manogi,项目名称:gfw-qm,代码行数:4,代码来源:EloquentUserRepository.php

示例14: verifyEmail

 /**
  * Handle email confirmation
  * 
  * @return void
  */
 public function verifyEmail($token)
 {
     $user = User::whereToken($token)->firstOrFail()->verifyEmail();
     \Notification::success(trans('registration.email_verification_successfull'));
     return redirect()->route('login');
 }
开发者ID:LichtAnd,项目名称:nkg,代码行数:11,代码来源:AuthController.php

示例15: emailConfirm

 public function emailConfirm($token)
 {
     try {
         //primeros buscamos al negocio que tenga el usuario del token
         //y asi le creamos la carpeta del negocio
         //comentamos por el polymorphic
         /*negocio = App\Negocio::whereHas('user', function ($query) use($token) {
               $query->where('token', $token);
           })->firstOrFail()->folderProfile();*/
         $negocio = App\Negocio::whereHas('admin', function ($query) use($token) {
             $query->join('users', 'admins.id', '=', 'users.user_id')->where('token', $token);
         })->firstOrFail()->folderProfile();
         //Ahora activamos al usuario
         $user = User::whereToken($token)->firstOrFail()->confirmEmail();
         return redirect('/login')->with('mensaje', '¡Su cuenta de usuario se ha activado, ahora puede iniciar sesión en su cuenta!');
     } catch (ModelNotFoundException $e) {
         return redirect('/login')->with('mensaje', 'Ya se ha confirmado a este usuario, solo inicie sesión ¬¬');
     }
 }
开发者ID:elotgamu,项目名称:app-isw,代码行数:19,代码来源:addnegocioController.php


注:本文中的app\User::whereToken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。