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

Aqeel94321's avatar

Multi-tenancy using Laravel App

Hi! Everyone. I want to make multi-tenant app using laravel but i don't want to use any multi-tenancy laravel package to achieve multi-tenancy.

Can you help me how to achieve multi-tenancy in laravel 6.0 i have achieved some task like( dynamic db created and migrate the migration related to tenant and redirect admin to its domain.) but in which i have some issue related to only admin redirect its domain..

1: if i create new user then it will not rediect to its domain that are admin domain. 2: how Sub-Domain Routing work? can i achieve multi-tenancy using sub-domain routing.

0 likes
14 replies
Aqeel94321's avatar

@sti3bas Thanks for your reply.

Every package have own limitations. Can you suggest best package for multi-tenancy and have demo project for that. i read documention of https://tenancy.dev/docs/hyn/5.4 but i can't understand how it work..

but my requirement is multi-tenancy with multiple databases because every client have confidential data.

1 like
Sti3bas's avatar

I've used hyn/multi-tenancy package in the past (and even made few contributions) and it worked really great.

Here is the boilerplate project https://github.com/peartreedigital/boilerplate

It's a bit old, but you should get the point by reading the code.

And yeah, it supports multiple databases.

Aqeel94321's avatar

@sti3bas Can you have "hyn 5.4" i only required simple project integration??

You say it worked really good but i face much difficulties to integration with this package. Can you send demo for that instead of this boiler plate that you mention above.

Sti3bas's avatar

@aqeel94321 I don't have any demo project. Just follow the docs and you will be able to setup it yourself.

1 like
Aqeel94321's avatar

@sti3bas Hyn documentation is not properly i read previously.

Thanks BTW. Your reply means to me.

maulesh's avatar

I have same with Hyn Documentation, Please share if any have Demo of laravel Multi Tenant

kh_dev1's avatar

hello everyone i doing on this also i need to dynamic database using this package but whenever i follow document in official always got error help please

Aqeel94321's avatar

@nithapple yes, I studied multi-tenancy very well and after this make own scenario of my application and make own multi-tenancy algorithm and its working fine for me.

you solve this problem or not, if not please concern with me i will help you very well.

dembilesmana's avatar

similarly, I also find it very difficult to understand the tenancy.dev documentation. :(

Please or to participate in this conversation.