简体   繁体   English

Laravel 5.6 Auth Register使用一个字段

[英]Laravel 5.6 Auth Register use one field

I am making a project with two way of register, depend on another column called 我正在用两种注册方式制作项目,取决于另一列

register_tupe (int)

So if the value of this column is 0, the registration will be with name, email and password 因此,如果此列的值为0,则将使用名称,电子邮件和密码进行注册

And if the value is 1, the registration will be with just a mobile number it's mean one field and if user enter his mobile number I'll send SMS message to the user with this activation number and after he enter the activation number he will redirect to other page witch he can complete the registration with his name, email and password. 如果值为1,则注册将仅带有一个手机号码,这意味着一个字段,如果用户输入他的手机号码,我将使用该激活码向用户发送SMS消息,在他输入激活码后,他将重定向转到其他页面,他可以使用他的姓名,电子邮件和密码来完成注册。

How can I do this in laravel? 我如何在laravel中做到这一点? I hope if any one can help me in this. 我希望有人能帮助我。

You need to make another table to store the unique activation code and mobile number of a user who wants to register on your website, do not run the registration process because in laravel you must need the email to save records in users table. 您需要创建另一个表来存储要在您的网站上注册的用户的唯一激活码和手机号码,不要运行注册过程,因为在laravel中,您需要电子邮件将记录保存在users表中。 Check in the register controller or where you are sending the request if the column flag is set to 1 then redirect to a view where user will enter the activation code, get that code and match with your database record if exists then mark it used by setting the used column value to 1, so you will know the code is already used after that make the registration process. 如果列标志设置为1,则在注册控制器中或在发送请求的位置进行检查,然后重定向到用户将在其中输入激活码的视图,获取该代码并与您的数据库记录匹配(如果存在),然后通过设置将其标记为使用将使用的列值设置为1,因此您将知道在进行注册过程之后该代码已被使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM