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

rahul.lamkhade's avatar

User - Service Request - Service Provider relation

I have doubt about which relationship should I use between these 3 models User - Service Request - Service Provider relation

The scenario is the user will submit a service request i.e user can place many service requests.

Any available Service provider will accept that request and complete it. So in this case Service request will have two keys for User and Service provider. How I can achieve that with the relationship.

Note: I am planning use Multiple auth for User and Service Provider Models so they have different tables as well as models (Any suggestions are acceptable in this part also as I am designing this project. Is multi-auth is ok?)

0 likes
2 replies
StefanVoinea's avatar

A User "hasMany" Service Request A Service Request "belongsTo" a User A Service Request "belongsTo" a Service Provider A Service Provider "hasMany" Service Request

rahul.lamkhade's avatar

@StefanVoinea Thanks for reply.

I have been thinking same but here problem is that how 1 service request entry in database will have both User and Service provider ids.

Please or to participate in this conversation.