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


PHP Guard::attempt方法代码示例

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


在下文中一共展示了Guard::attempt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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('/');
     }
     return redirect('/auth/login')->withErrors(['email' => 'These credentials do not match our records.']);
 }
开发者ID:praisegeek,项目名称:laravel-multiple-locales,代码行数:13,代码来源:AuthController.php

示例2: doLogin

 /**
  * Do login authentication
  *
  * @param CreateAuthRequest $request
  * @return $this|\Illuminate\Http\RedirectResponse
  */
 public function doLogin(CreateAuthRequest $request)
 {
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, true)) {
         return redirect()->route('admin.dashboard');
     }
     return redirect()->back()->withErrors(['general' => 'Invalid username or password!']);
 }
开发者ID:vjaykoogu,项目名称:smile-media-laravel,代码行数:14,代码来源:AuthController.php

示例3: doLogin

 public function doLogin(LoginRequest $request)
 {
     if ($this->auth->attempt($request->only('email', 'password'), $request->has('remember'))) {
         return redirect('/');
     } else {
         return redirect('/auth/login')->withErrors(['email' => 'These credentials do not match our records.'])->withInput();
     }
 }
开发者ID:Hayk009,项目名称:blog,代码行数:8,代码来源:AuthController.php

示例4: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  LoginRequest $request
  * @return Response
  */
 public function postLogin(Requests\Auth\LoginRequest $request)
 {
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect('/home');
     }
     return redirect('/auth/login')->withInput($request->only('email'))->withErrors(['email' => 'These credentials do not match our records.']);
 }
开发者ID:za-web,项目名称:l5-app,代码行数:14,代码来源:AuthController.php

示例5: postLogin

 public function postLogin(LoginRequest $request)
 {
     $this->validate($request, ['email' => 'required|email', 'password' => 'required']);
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect()->intended('jandje');
     }
     return redirect('jandje/login')->withInput($request->only('email', 'remember'))->with('message', 'De opgegeven gegevens zijn niet correct. Probeer het opnieuw.');
 }
开发者ID:jeroenhekihenk,项目名称:video-platform,代码行数:9,代码来源:AdminController.php

示例6: postLogin

 public function postLogin(Request $request)
 {
     $this->validate($request, ['email' => 'required|email', 'password' => 'required'], ['email.required' => 'Поле email не заполнено', 'email.email' => 'Введен не верный email', 'password.required' => 'Пароль не введен']);
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect()->route('admin.index');
     }
     return redirect()->route('admin.login')->withInput($credentials)->withErrors(['email' => 'Неверный email или пароль']);
 }
开发者ID:qubikr,项目名称:laravel,代码行数:9,代码来源:AuthenticatesUser.php

示例7: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postLogin(Request $request)
 {
     $this->validate($request, ['email' => 'required|email', 'password' => 'required']);
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect()->intended('/' . Config::get('lecter.uri'));
     }
     return redirect('auth/login')->withInput($request->only('email', 'remember'))->withErrors(['email' => 'Sorry, login failed... check your credentials.']);
 }
开发者ID:mrjuliuss,项目名称:lecter,代码行数:15,代码来源:AuthController.php

示例8: store

 /**
  * Handle a login request to the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function store()
 {
     $this->validate($this->request);
     $credentials = $this->request->only('email', 'password');
     if ($this->auth->attempt($credentials, $this->request->has('remember'))) {
         return redirect()->intended(route('admin.dashboard.index'))->with('success', 'You have logged in.');
     }
     return redirect()->route('auth.session.create')->with('danger', 'These credentials do not match our records.')->withInput($this->request->only('email'));
 }
开发者ID:rtablada,项目名称:student-grading,代码行数:14,代码来源:SessionController.php

示例9: postLogin

 public function postLogin(LoginForm $form)
 {
     $attempt = $this->auth->attempt(['email' => $form->email, 'password' => $form->password, 'is_active' => true], $form->has('remember'));
     if (!$attempt) {
         flash()->error(trans('administr::auth.wrong_user_or_pass'));
         return back();
     }
     return redirect()->intended(route('administr.dashboard.index'));
 }
开发者ID:administrcms,项目名称:administr,代码行数:9,代码来源:AuthController.php

示例10: postLogin

 /**
  * @param LoginRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postLogin(LoginRequest $request)
 {
     $result = $this->auth->attempt($request->only(['email', 'password']), $request->get('remember', false));
     if (!$result) {
         return redirect()->route('get.login')->with('message', 'ユーザー認証に失敗しました');
     }
     return redirect()->route('admin.entry.index');
     //return redirect()->route('auth.get.login');
 }
开发者ID:nazonohito51,项目名称:laravel-jp-reference-chapter8,代码行数:13,代码来源:AuthController.php

示例11: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postLogin(Request $request)
 {
     $this->validate($request, ['email' => 'required|email|in:mr.jschauhan@gmail.com,fernandes.joyson@gmail.com,nikulshah2002@yahoo.com', 'password' => 'required']);
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect()->intended($this->redirectPath());
     }
     return redirect($this->loginPath())->withInput($request->only('email', 'remember'))->withErrors(['email' => $this->getFailedLoginMessage()]);
 }
开发者ID:jasbirsingh-c,项目名称:sharemarket_web360,代码行数:15,代码来源:AuthenticatesAndRegistersUsers.php

示例12: byCredentials

 /**
  * @param array $credentials
  *
  * @param bool  $remeber
  *
  * @return true
  */
 public function byCredentials(array $credentials, $remeber = false)
 {
     $email = array_get($credentials, 'email');
     if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
         $credentials['username'] = $email;
         unset($credentials['email']);
     }
     return $this->auth->attempt($credentials);
 }
开发者ID:AdrianoBiolchi,项目名称:forum,代码行数:16,代码来源:AuthService.php

示例13: DoLogin

 /**
  * Handle a login request to the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function DoLogin(\Illuminate\Http\Request $request)
 {
     $this->validate($request, ['username' => 'required', 'password' => 'required']);
     $credentials = $request->only('username', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect('/settings');
     }
     return redirect()->action('Auth\\AuthController@ShowLogin')->withInput($request->only('username', 'remember', 'name'))->withErrors(['username' => 'These credentials do not match our records.']);
 }
开发者ID:ChristopherCotnoir,项目名称:Sequoyah,代码行数:15,代码来源:AuthController.php

示例14: postLogin

 /**
  * Handle a login request to the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postLogin(Request $request)
 {
     $this->validate($request, ['email' => 'required', 'password' => 'required']);
     $credentials = $request->only('email', 'password');
     if ($this->auth->attempt($credentials, $request->has('remember'))) {
         return redirect()->intended($this->redirectPath());
     }
     return redirect($this->loginPath())->withInput($request->only('email', 'remember'))->withErrors(['email' => 'These credentials do not match our records.']);
 }
开发者ID:cloud5ideas,项目名称:appkit,代码行数:15,代码来源:AuthenticatesAndRegistersUsersTrait.php

示例15: attemptLogin

 protected function attemptLogin(Request $request)
 {
     $credentials = ['email' => $request->get('email'), 'password' => $request->get('password')];
     $rules = [];
     $validator = Validator::make($credentials, $rules);
     if ($validator->fails()) {
         throw new \Exception('Fatal Error :: Validation Failed!!');
     }
     return $this->authManager->attempt($credentials) ? redirect('admin') : redirect('admin/login');
 }
开发者ID:bibekbhattaraibrt,项目名称:football,代码行数:10,代码来源:AuthController.php


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