本文整理汇总了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);
}
}