Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question