alturic
527
2
Laravel

User (client) Accounts & Sub Accounts?

Posted 1 year ago by alturic

Hi guys, I'm wondering how difficult it would be to have a User account and then sub accounts for that User?

In the simplest example, think of a billing system, the client (User) is the one who is paying the bill and has all of the paid products associated with it. They might also want to make a sub account for a billing manager. A sub account for a manager. A sub account for a shift supervisor, etc.

What I'm looking to achieve:

The client (User) also has managers (sub accounts) that are going to have accounts, however those sub accounts are going to need to tie back to the client (User) for referencing all sorts of information they should be able to access. The client may set sub account #1 to have full access to all client (User) products. However, the client may set sub account #2 to only have access to a few products the client has access to, etc.

From a DB level, I'd need(?) a client table, a sub-account table (with a client_id column to reference back), a client_product table and then a whole host of other tables that are tied to the client, with pivot tables referencing the client, sub-account and client's product_id's.

Then on /login I'd check if the email address is contained in the client table, if not, check the sub-account table, etc.

I just don't know how difficult that would be to achieve in Laravel. :-/

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.