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


PHP Authenticator::attempt方法代码示例

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


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

示例1: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     if ($this->auth->attempt($request->only('email', 'password'))) {
         return redirect('/dash-board');
     }
     return redirect('/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']);
 }
开发者ID:kemri-ucsf,项目名称:nationalHIVMentorship,代码行数:13,代码来源:AuthController.php

示例2: postLogin

 public function postLogin(LoginRequest $request)
 {
     if ($this->auth->attempt($request->only('email', 'password'))) {
         return redirect('/users/' . $request->user()->name);
     }
     return redirect('/auth/login')->withErrors(['email' => 'These credentials do not match our records.']);
 }
开发者ID:lshakeel,项目名称:WE_Assignment3,代码行数:7,代码来源:AuthController.php

示例3: postLogin

 protected function postLogin(LoginRequest $request)
 {
     if ($this->auth->attempt($request->only('email', 'password'))) {
         return redirect()->route('users');
     }
     return redirect('/')->withErrors(['error' => 'The email or the password is invalid. Please try again.']);
 }
开发者ID:mainetwork09,项目名称:interview-test,代码行数:7,代码来源:AuthController.php

示例4: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     $user = User::where('username', '=', $request->username)->first();
     if (isset($user)) {
         if ($user->password == md5($request->password)) {
             // If their password is still MD5
             $user->password = bcrypt($request->password);
             // Convert to new format
             $user->save();
         }
         if ($user->confermato) {
             $remember = null !== $request->get("remember-me") ? true : false;
             if ($this->auth->attempt($request->only('username', 'password'), $remember)) {
                 if ($request->ajax()) {
                     return Response::json(array('code' => '200', 'msg' => 'OK'));
                 } else {
                     if ($this->auth->user()->ruolo == 1) {
                         return redirect('admin');
                     } else {
                         return redirect('/');
                     }
                 }
             }
         }
     }
     if ($request->ajax()) {
         return Response::json(array('code' => '500', 'msg' => $this->getFailedLoginMessage()));
     } else {
         return redirect('/auth/login')->withErrors(['email' => $this->getFailedLoginMessage()]);
     }
 }
开发者ID:abada,项目名称:HolisticRemedies,代码行数:37,代码来源:AuthController.php

示例5: postLogin

 public function postLogin(LoginRequest $request)
 {
     if ($this->auth->attempt($request->only('email', 'password', 'user_type'))) {
         $user = \Auth::user();
         if ($user->user_type == 1) {
             return redirect('/homepage');
         } elseif ($user->user_type == 2) {
             return redirect('/student');
         } elseif ($user->user_type == 3) {
             return redirect('/dash-board');
         }
         //return view('dashboard', compact('user'));
     } else {
         return redirect('/auth/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']);
     }
 }
开发者ID:nahid1991,项目名称:LoginTest,代码行数:16,代码来源:AuthController.php

示例6: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     \Log::info("-----------------this is fucking working driver auth controller.php");
     $a = array('email' => $request->input('email', 'email not found'), 'password' => $request->input('password', 'password not found'));
     //   $tasks = DB::select('SELECT * FROM tasks where user_id = 6;');
     //    \Log::info($tasks);
     \Log::info("trying to attepm to loging");
     \Log::info($a);
     $b = $request->all();
     \Log::info("all fields are");
     \Log::info($b);
     if ($this->auth->attempt($a)) {
         \Log::info('.............log in successful.........');
         $ownedBookList = DB::select('SELECT * FROM ownedbooklist where userId = ?;', [13]);
         \Log::info($ownedBookList);
         \Log::info('sending date to view');
         //    return redirect('user/login')->with('message', 'Login Failed');
         return redirect('user/userhomepage');
     }
     /*   if ($this->auth->attempt($request->only('email', 'password')))
             {
                 return redirect('/tasks');
             }
     
         */
     \Log::info("login failed");
     return redirect('auth/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']);
 }
开发者ID:shafi-,项目名称:vlibrary,代码行数:34,代码来源:AuthController.php

示例7: postRegister

 protected function postRegister(RegisterRequest $request)
 {
     $this->user->email = $request->email;
     $this->user->password = bcrypt($request->password);
     $this->user->save();
     if ($this->auth->attempt($request->only('email', 'password'))) {
         return redirect()->intended('/account/vehicles/types');
     }
 }
开发者ID:soyFelixBarros,项目名称:AutosDelNea,代码行数:9,代码来源:AuthController.php

示例8: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest  $request
  * @return Response
  */
 public function postLogin(LoginRequest $request)
 {
     $a = array('email' => $request->input('email', 'email not found'), 'password' => $request->input('password', 'password not found'));
     $b = $request->all();
     if ($this->auth->attempt($a)) {
         $ownedBookList = DB::select('SELECT * FROM ownedbooklist where userId = ?;', [13]);
         return redirect('userhomepage');
     }
     \Log::info("login failed");
     return redirect('auth/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']);
 }
开发者ID:alalamin25,项目名称:virtuallibrary,代码行数:17,代码来源:AuthController.php

示例9: postLogin

 protected function postLogin(LoginRequest $request)
 {
     $checked = $request->input('remember');
     //dd($this->auth->viaRemember());
     if ($this->auth->viaRemember()) {
         //Always false? Needs fix but "Remember Me" works!
         return redirect()->route('dashboard');
     } else {
         //Then set remember as user opts!
         if (isset($checked)) {
             if ($this->auth->attempt($request->only('email', 'password'), true)) {
                 return redirect()->route('dashboard');
             }
         } else {
             if ($this->auth->attempt($request->only('email', 'password'), false)) {
                 return redirect()->route('dashboard');
             }
         }
     }
     return redirect('users/login')->withErrors(['email' => 'The email or the password is invalid. Please try again.']);
 }
开发者ID:bhavyanshu,项目名称:OpenMedMan,代码行数:21,代码来源:AuthController.php

示例10: postRegister

 protected function postRegister(RegisterRequest $request)
 {
     //$this->user->name = $request->name;
     $this->user->email = $request->email;
     $this->user->password = bcrypt($request->password);
     $this->user->is_admin = 0;
     $this->user->role = 'E';
     $this->user->save();
     //return redirect('laravel_angular/users/login');
     if ($this->auth->attempt($request->only('email', 'password'))) {
         $user = $this->auth->user();
         $employee = new Employee();
         $employee->name = $request->name;
         $employee->email = $request->email;
         //$employee->contact_number = $request->contact_number;
         //$employee->position = $request->position;
         $employee->user_id = $user->id;
         $employee->save();
         return redirect()->route('dashboard')->with('name', $request->name);
     }
 }
开发者ID:subhankarbachchu,项目名称:laravel_angular,代码行数:21,代码来源:AuthController.php


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