F
Filament3mo ago
AgonK

how to use SaaS with filament and multiple databases ?

I have a SaaS API and now I'm implementing filament for the front end part. I don't have any experience with filament and I'm having some trouble at this point and I'm trying to tell you my problem I have a master database wich is default (in .env) and when user submit the login form on filament I get this credentials and find the corresponding database and reconnect it. To make this possible I've override the authenticate function from filament. My excpectation will be from this point everything should work like single database like eloquent queries until next login. But after login in some other function the database stay the same as default database. I think the database doesn't change globally. Is there any solution about that, or I miss something here ?
1 Reply
Dennis Koch
Dennis Koch3mo ago
Hard to help without any code. I doubt there is a solution where you just change something during authentication once. I'd use a middleware to identify the tenant and setup the db connection
Want results from more Discord servers?
Add your server