cancreate's avatar

Best Approach to handle Buyers and Sellers Authentication & Panel Separation in e-Commerce website

I am building a multi vendor e-Commerce system in Laravel and am wondering what would be the best approach or way to handle different application stakeholders for authentication and panel separation . There are 2 types of stakeholders:

  • Buyers
  • Sellers
Buyers: can view products on website listed by sellers, can place orders and most importantly they will have user area(like AliExpress.com) where they can view orders history, add/delete payment methods, add delete addresses etc.

Sellers: A Seller can be buyer and seller at same time so, they will share same user area like buyers have but, additionally they will have a dedicated seller Dashboard(hosted on a subdomain like seller.abc.com) where they have options like Product management, Order management etc. A seller can also create sub-users with roles like product lister, order manager etc. Each user created by seller with assigned role will have it's own permissions.

Similarities in User schema: Buyers & Sellers will have similar columns.

So, should I split them in different tables and authenticate using guards and providers? or should I keep them in one table "users" and restrict them via middleware only?

There won't be any all in one "Admin panel" to manage everything but in future I will create separate panels for different teams for example a panel for support team where they can approve seller listings disable/enable accounts etc.

I hope I cleared everything in detail if not please do let me know I'm really confused as it is going to be large project for me

0 likes
2 replies
jlrdw's avatar

I would suggest checking GitHub and see if there are any packages available where you can study the code of how they did things.

Since a user can be a seller or a buyer, I would probably use one table but have a boolean differentiate whether at the time they are buying or selling.

Please or to participate in this conversation.