本文整理匯總了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);
}
示例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');
}
示例3: getLogin
public function getLogin()
{
if (Auth::viaRemember()) {
return redirect()->intended('admin');
}
return view('admin::login');
}
示例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);
}
示例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');
}
示例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();
}
示例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);
}
}