Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9030755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:34:08+00:00 2026-06-16T07:34:08+00:00

I am building a web application that has users and orders. I have a

  • 0

I am building a web application that has users and orders. I have a question about how to handle the relationship between the two.

An order belongs to a user. But here’s the twist, a user can optionally choose to outsource an order to another user.

When an order is outsourced, the original user still remains the owner and only he can modify certain things like price, quantity etc on the order.
The user the order is outsourced to can view some of the order information and can update specific properties on the order like marking as fulfilled.
An outsourced order should show up on both users “orders index”.

All the users are “equal” meaning on certain orders a user might be the owner and on others he might be fulfilling the order. A user can also fulfill his own orders.

It doesn’t seem like a true many to many relationship as one of the users doesn’t really own the order, he just has limited access to it.

What would be the simplest way to handle this order/users relationships? I would like to avoid using a complete permission system, is there a way to simply handle this with an “outsourced” table? How about having a user_id and outsourced_to field on the order table?

Thanks for your input!

If it’s of any help, the application uses Laravel.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:34:09+00:00Added an answer on June 16, 2026 at 7:34 am

    It seems like your Orders table has two separate relationships with the Users table.
    Orders have an owns/owned-by relationship to Users.

    Users(1) -- owns -- (*)Orders
    

    One User can own many Orders. One Order is owned by only one User

    Then there is a completely separate outsourced-to relationship between Orders and Users.

    Orders(*) -- outsourced-to -- (1)Users
    

    (Here I assume that an Order can only be outsourced to one other User. A User may have many Orders outsourced to them.)

    The best way to represent this is to have the Orders table have a ‘owner’ foreign key column into the Users table and another ‘outsourced_to’ foreign key column also to the Users table.

    What columns of Orders the outsourced user can edit will be controlled by the code and not by the dB.

    A separate outsourced table will be needed only if Orders can be outsourced to multiple Users at the same time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a web application using ASP.NET MVC that has two very distinct
I'm currently building a web application that has multiple user types, where users engage
I am building a web application that has a real-time feed (similar to Facebook's
I am building a googlemaps web application that has a series of static markers
I am building a web application that will need to allow users to save
I'm building a web application that shows users interesting visualizations of their Gmail activity
I am building a web application that will essentially allow authenticated users access to
I'm building a web-based productivity application that has to deal with modest user concurrency,
I am building an application that has a web front end and a desktop
We are currently building a web-based application that has the need to associate a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.