T
T
Terroris3372020-09-17 13:44:55
Laravel
Terroris337, 2020-09-17 13:44:55

How to implement multiple personal cabinets?

You need to make several personal accounts in the online store, LC for ordinary users and for partners, users log in by mobile number and password, and partners by email and password, respectively, two forms of registration and login.

How can I implement this in the database, do I need to make a separate table of partners and attach Laravel authorization, or do I do it through one users table with the role system? If through the users table, then how to follow the entry in several fields (by email or by number)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-09-17
@Terroris337

About logging in using multiple fields: You can go the hard way - study the facades, extend the Auth facade and apply https://laravel.com/docs/8.x/authentication#authen...
You can go the easy way - find the right user in the controller with your hands and pass it to https://laravel.com/docs/8.x/authentication#other-...
About roles - for the simplest case, a field in the users table and writing gates / policies is enough:
https://laravel.com/docs /8.x/authorization#gates

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question