How do you create multiple registration in laravel - laravel

I'm using laravel 6 and I want to create an app with two different users. One user is a user registering on the app as an individual while the other user is a user registering on behalf of a company/organization.
For an individual user, firstname, lastname, email and password fields are required while for the company/organization, the companyname, email and password are required. I would like to have two registration forms to register the two types of users.
I have searched for a similar question but the one I found on this platform wasn't answered. Kindly help.

Seems to me that this tutorial could be what you're looking for: https://laravelarticle.com/laravel-multi-authentication
It creates authentication system for two user groups - regular and admin users.

Related

Laravel: Using multiple columns for authentication in passport

Note: I have asked a similar question here: Laravel: Using multiple columns for authentication but this question is referring specifically to Passport.
I have a Laravel 6 application that uses Passport.
In a typical application, the user would just specify their email, where the email is unique.
However, in my application, I have 2 columns in the User model that is used to authenticate users.
app_id (usually sent as a header)
email
unique(app_id, email)
So in order to login, we need to pass both an app_id and an email, along with the password. The same email could be used across different app_ids.
How would I achieve this?

How to make user email unique based on user roles

I am new to laravel i am using laravel 6x.
Now i want to know how to make user email unique based on user roles .I am using spatie permissions
I have two type of users
admin
End user
Now i want to use laravel validation for same email for different roles,that means, email should be unique by roles.
Anybody has any idea, please let me know

How to authenticate users with an integer such as account number as the username

I have a problem authenticating users in my banking application. I want super users to be created and authenticated using email. However, I want that normal users be registered and assigned account numbers. The normal users would then use the account numbers to login. How do you achieve authentication of these different kinds of users with different username fields in one django project.
I have tried overriding the USERNAME_FIELD to account numbers so that normal users would use that to login. It doesnt help to login normal users. For superusers, it prompts for account number when I run
python manage.py createsuperuser
Kindly assist in understanding how to handle this kind of custom authentication.
Django is ready to support your requirement. AUTHENTICATION_BACKENDS support multiple backend as list. For normal user you have to write custom backend and Add that in AUTHENTICATION_BACKENDS.
This link will help you.

Authenticate by one of multiple email addresses per user

A user can have multiple emails. I got two tables "users" and "user_emails". Registration is working fine and it writes the email to user_emails.
Later the users shell be able to add more email-adresses within a backend gui. Now i am stuck with the verification at login, as a user should be able to use any of the email adresses out of "user_emails" with the passwort out of "users".
What do i have to do to get this working?
Thank you.

Best Approach on Social Authentication Providers

Currently I am developing an application with several access methods based on Laravel/Socialite, I want to allow users authenticate with facebook, twitter, google so far or creates it's own account by filling a form with name, email, password.
Routes
login/
login/facebook
login/twitter
login/google
Questions :
¿What is the best approach once the User data has been obtained from the auth provider?
¿How to handle a common data user storage?, I mean, I am storing only person name, email and avatar, but how about the token provided by the auth process.
¿How to handle when user log in with more of 1 providers with a same email address?
And how to handle when a user set password to his account created trough facebook?
I thank your attention .

Resources