Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

amadeann's avatar

Marketplace in Laravel - approach to handling sellers, buyers and admins

Context:

I am building a small marketplace in Laravel for my business and am wondering what would be the recommended approach to handling different application stakeholders. There are 3 types of stakeholders:

  • customers (ordering the service from providers)
  • providers (providing the service to customers)
  • admins/managers (dispatching providers in their region, handling complaints, payments etc.)

Each of the stakeholders is assigned to a particular 'region' - e.g. a manager in Phoenix can see only customers and providers in Phoenix, the manager from Tuscon sees customers and providers in Tuscon etc. All stakeholders should be able to access their respective admin panels/accounts - customers should be able to order services and manage existing bookings, providers should be able to manage their 'jobs' and sign up for new jobs, and managers (admins) should be able to do both (already implemented).

At this point, I only implemented the 'manager' admin panel, which is handled by the default User model. Effectively it means that the marketplace is managed by a manager, but there is no 'self-service' for customers and providers. Customer and providers data is handled by their respective Eloquent models.

Question:

What would be a better way to implement such self-service:

Option 1. Keep the authentication of customers and providers in their current Eloquent models and utilize custom guards. Option 2. Bring customer and provider data to the user model (where managers currently are) and handle the authentication through user roles. Customers and providers would then have a belongsTo relationship with respect to the user table.

0 likes
2 replies
amadeann's avatar

Thanks @andreasbakir for your answer. Do you recommend the roles-based approach because it is just simpler or the other one, with 3 separate models for different types of users is just a wrong approach in the first place?

Please or to participate in this conversation.