2018-07-23 23:47
浏览 43

使用Laravel 5.6在同一页面上登录和注册?

So I'm creating an e-commerce website and working with Laravel 5.6 which I do not have as much experience as I would be comfortable with even though I took a Udemy course on it.

So if an unauthorized user if(!Auth::check()) goes to the root directory / there is a login form along with a Sign in and Sign up button. The Sign up button is supposed to then change the form for signing in to sign up with additional fields like first and last name.

What is the most painless way to do this in Laravel 5.6? I was thinking maybe I could somehow utilize @section and @yield but I'm honestly not sure and I don't want to mess anything up.

图片转代码服务由CSDN问答提供 功能建议

所以我正在创建一个电子商务网站并使用Laravel 5.6,我没有那么多经验 即使我接受了Udemy课程,我也会感到很自在。

因此,如果未经授权的用户 if(!Auth :: check())转到 根目录 / 有一个登录表单以及登录注册按钮。 然后,注册按钮会更改登录表单以注册其他字段,如名字和姓氏。

最简单的方式是什么? 在Laravel 5.6中做到这一点? 我想也许我可以以某种方式利用 @section @yield 但我老实说不确定,我不想弄乱任何东西。 \ n

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • dqwh2717 2018-07-24 05:10

    Create one page:

    1. Create Login Form in this page
    2. Create Register Form in this page too
    3. Hide Register Form using CSS or whatever
    4. Create event on Sign up button to hide Login Form and Show Register form using JS
    解决 无用
    打赏 举报

相关推荐 更多相似问题