I'm working on moving an already developed [1] - but not used - application to be multi-tenant aware instead of installing it seven times (for seven departments inside the same company). Im currently looking into stancl/tenancy as this was mentioned here in the forum. According to what I've read, different databases for tenants would be better as the data mainly needs to be segregated between the tennants. Only a few very select lookups for other-tennants data are needed.
So my idea was to store data, that is common to all tennants (e.g. a List of Streets for autocompletion) on the central database, everything tenant specific will be in the tenant database.
BUT
I would like to have the users log in on the central database. My reasoning behind this: There are - not many but some - overlapping users, which need to access multiple tenants. And by this approach they don't need to have multiple accounts. Changing to a SSO Privider may be a solution? Or is it easier to have users also decentralized and those few who need to access mutiple have to use multiple logins. What if the should have different permissions in different tenants?
For tenant switching I'm currently not shure if using subdomains will be possible. So as a fallback I'd like to have a way to switch the tenant based on a user-select inside the application. After Login they should be assigned to one tenant (as the majority has only one available tenant).
[1] the application is almost finished (approx 10% remaining). It's based on Laravel11 and using Blade and spatie/permissions