简体   繁体   中英

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

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.

How can I do this in 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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