當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth::viaRemember方法代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Auth::viaRemember方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::viaRemember方法的具體用法?PHP Auth::viaRemember怎麽用?PHP Auth::viaRemember使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Support\Facades\Auth的用法示例。


在下文中一共展示了Auth::viaRemember方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct()
 {
     $this->loggedInUser = Auth::User();
     $this->loggedInViaRememberMe = Auth::viaRemember();
     view()->share('isSignedIn', Auth::check());
     view()->share('user', $this->loggedInUser);
 }
開發者ID:BarkaBoss,項目名稱:TheHex,代碼行數:7,代碼來源:Controller.php

示例2: getLogin

 /**
  * Show the application login form.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogin()
 {
     if (Auth::viaRemember()) {
         redirect()->intended($this->redirectPath());
     }
     return view('auth.login');
 }
開發者ID:BlueBayTravel,項目名稱:deployer,代碼行數:12,代碼來源:AuthController.php

示例3: getLogin

 public function getLogin()
 {
     if (Auth::viaRemember()) {
         return redirect()->intended('admin');
     }
     return view('admin::login');
 }
開發者ID:Phrantiques,項目名稱:toolbox-laravel,代碼行數:7,代碼來源:AuthController.php

示例4: handle

 public function handle($request, Closure $next)
 {
     if (!Auth::check() or Auth::viaRemember()) {
         return redirect()->route('home.index')->withErrors(['Por favor, faça o login']);
     }
     $role = $this->authService->getUserRole();
     if ($role != 'aluno') {
         return redirect()->back()->withErrors(['Você não tem permissão para acessar esta página']);
     }
     return $next($request);
 }
開發者ID:RenatoTheodoro,項目名稱:mahaGeo,代碼行數:11,代碼來源:AlunoAuth.php

示例5: showLoginView

 function showLoginView()
 {
     if (Auth::check()) {
         return View::make('about');
         // return Redirect::to('/about');
     }
     if (Auth::viaRemember()) {
         return View::make('about');
         //return Redirect::to('/about');
     }
     return View::make('login');
 }
開發者ID:shahariar007,項目名稱:LaravelTest,代碼行數:12,代碼來源:loginController.php

示例6: createLogin

 public function createLogin(Request $request)
 {
     $user_name = $request->input('user_name');
     $password = $request->input('password');
     //This line creates a login in credential for you
     $user = (new user())->create(['user_name' => $user_name, 'password' => Hash::make($password), "user_role" => 1]);
     if (Auth::attempt(['user_name' => $user_name, 'password' => $password], true) || Auth::viaRemember()) {
         return redirect('/dashboard');
     }
     return $this->getLogin();
 }
開發者ID:bigschlong69,項目名稱:capstoneAll,代碼行數:11,代碼來源:AuthController.php

示例7: login

 /**
  * Login page of the user
  *
  * @return $this|Redirect
  */
 public function login()
 {
     if (Auth::check()) {
         //if user already logged in
         return redirect($this->login_redirect);
     } elseif (Auth::viaRemember()) {
         //if user set remember me token
         return redirect($this->login_redirect);
     } else {
         return view('users::login')->with('layout', $this->layout);
     }
 }
開發者ID:gitllermopalafox,項目名稱:user,代碼行數:17,代碼來源:UsersController.php


注:本文中的Illuminate\Support\Facades\Auth::viaRemember方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。