douningchang3610 2017-12-05 09:52
浏览 41

使用php framework laravel登录后重定向页面

I'm trying to show a page from myController after successful to login.

$email = $req->input('username');
$pass = $req->input('password');
$login = DB::table('for_login')->where(['E_mail'=>$email, 'Password'=>$pass])->get();
if(count($login)>0) {              
    return view('frontEnd.Home');
} else {
    echo "Invalid username/password";
}

How can I redirect a page after a successful login?

delAction

  • 写回答

3条回答 默认 最新

  • dongyuan8024 2017-12-05 09:58
    关注

    Go to AuthController.php and add authenticated method'

    protected function authenticated($request){
        return view('frontEnd.home');
    }
    

    The built-in authentication functionality of laravel looks for authenticated method upon successful login and performs it, if it is declared. Hope this helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作