Is Filament V3 with compatible with tenancyforlaravel https://tenancyforlaravel.com/
i have i big issue with tenants connecting the database , i'm applying multi database architecture
22 Replies
Hello bro, hey why don't you use only if you use separate databases it would be interesting, I am working on a Saas tenancy with separate databases but using a different package, specifically the one here https://tenancy.dev/
Tenancy
The multi tenant saas toolkit for Laravel
Tenancy allows you to easily scaffold a multi-tenant SaaS platform on top of the Laravel framework.
first time to hear about this package 😄 but all the recommendation goes for tenancywithlaravel and it provide SSO too 😄 , i will try this package you mentioned 😄
@Dennis Koch 😄
So, what did you do so far to make Filament work with Tenancy For Laravel?
Did you add the middlewares?
in database.php i added
You need to add the Tenant Middlewares:
and in env i added that
this middleware doesnt exist PreventAccessFromUnwantedDomains
the documentation is not clear on this topic 😅
Sorry, I am using the alpha version of Tenancy but it should have a similar middleware that you need to add
pardon me , what is the alpha version ?
do you mean the package called tenancy/tenancy
There's a closed-access alpha for stancl/tenancy
hmmm i understand 😄
You don't need it to work. The other middleware is the important part
ok, what about redirecting filament to read from the database of a specific tenant , can you help with that 😄
i mean the database configration in ( .env , database.php , tenancy.php)
It's all about the middleware. If that one is missing, the tenancy package always assumes, you are on central connection
i will check it out 😄
in database.php
in tenancy.php
in .env file
each tenant will have a database with his name
is this configuration correct 😅
because it is reading from a weird connection called tenant witch i dont have
That's the default connection name the package uses. Just rename your tenant connection. Or adjust the configuration of tenancy.php
i will check it out , thanks a lot 😄
the thing it is no dynamic , i want it to be changed dynamically with tenant database name , username , password 🤔
It expects your databases to be in format
central_name_number
like mysql_1
but i want the tenant name to be in strings not numbers 😄 as it will be the also the database name
You should maybe make the default work first before making things more complicated.
Hello,
The alpha version is the future v4 version, right?
does stancl/tenancy "alpha" ( v4 ) work better with filament v3?
For filament v2 and stancl/tenancy found this documentation https://filamentphp.com/docs/2.x/admin/resources/getting-started#stancltenancy
No much difference I think apart from the public storage linking