One series that might help is:
Multi "Domain" with Laravel?
Well, the case I'd like to ask about is not really about subdomains or even domains, like bla.main.com, but rather the opposite.
Let's say, I have a single system that is in use by multiple companies. Right now, the system works in the following way:
- All users are being authenticated via LDAP (already implemented in my system);
- Once user is logged in, he is being automatically redirected to a session-stored "domain" and url changes from "oldsystem.com" to "oldsystem.com/companyname"
Let's also say that every user is being tied to a single company, except few super-admins that have access accross all "domains".
I'm trying to implement the same thing and exploring all possibilities. This "domain" (I'm calling this as a domain, since I can't think of a better alternative, as it is not a sub/domain by itself, just a system part) has a company-specific functionality, but user is able to switch it (if he has permission to do so, of course).
Any ideas on how to implement this better? All the packages I've seen on GitHub are intended specifically for multi-domain usage with subdomains (or even 2nd level domains), but this is not exactly what I want to.
That's an example:
- User logs in;
- Since the user is tied to Company2, he is being redirected to website.com/company2/home;
- website.com/company2 has features A, B, C, D and E. website.com/company1 has features A, B, F, G, H (each feature may be unique or shared one);
- If the user has the permission to switch between companies, he can do so (website.com/company2 -> website.com/company1).
Database connections and server are the same, regardless of the selected company.
Kind regards for any suggestions ;)
Please or to participate in this conversation.