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

jobcerto's avatar

Multi Tentant with admin area

I know how to create a multi tenant (multi database) application. But now my client needs an area with information about all companies (each company use one separate database).

is there a package that can filter data from multiple databases at the same time?

0 likes
3 replies
Cronix's avatar
Cronix
Best Answer
Level 67

You've hit quite a problem. There are 2 designs for tenant db. One uses a single db and a FK for each tenant in the tables. This allows you to easily do what you're trying to do. The other way is how you did, with each tenant having their own db. That makes it hard to get data for all tenants. You'll probably have to query each one separately, unfortunately.

Here's a really good video from Tom Schlick at Laracon last year giving a talk on the pros/cons of each method: https://streamacon.com/video/laracon-us-2017/day-1-tom-schlick

1 like
Cronix's avatar

Seems to be what I said you'd need to do lol

Please or to participate in this conversation.