當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。