Filament 3 with Stancl/Tenancy
Hey everyone, has anyone tried using Filament 3 with multiple databases and exclusively for tenants? I'm facing an issue where I want to use Filament 3 in tenants and create a separate Filament panel for the central domain. I attempted to set it up in the central domain, but when I tried to use it in a tenant and added 'PreventAccessFromCentralDomains' on the tenant panel, the styles and assets disappeared. Has anyone encountered a similar problem or found a solution for this?
14 Replies
I hope this will help
https://gist.github.com/Hegabovic/81d63f16dcceac16ecbdd0c3722857ae
Gist
Full Guide for Multi-tenancy with tenancy with laravel package
Full Guide for Multi-tenancy with tenancy with laravel package - multi-tenancy.md
Thanks for that. How about the filament? my goal is to use filament in tenant.
yes this is for filament
it also planned to be published on filament website
https://github.com/filamentphp/filamentphp.com/pull/219/files?short_path=42ea11d#diff-42ea11d9c4ec21fe833aad320029ffeaf3756de5928e0b42f66c6ad274113c1c
GitHub
filament integration with Tenancywithlaravel Full Guide Article by...
a step by step guide which will take your application from single user to multi-tenant application
here is the result when using with the tenant,
assets/style does not load properly. But when using the filament with the central domain it works.
from the docs
https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/#filesystem-tenancy-boostrapper
You can disable tenancy of asset() in the config (tenancy.filesystem.asset_helper_tenancy) and explicitly use tenant_asset() instead. tenant_asset() always returns a path to the TenantAssetController: tenant_asset('foo.txt') returns your-site.com/tenancy/assets/foo.txt. You may want to do that if you're facing issues using a package that utilizes asset() inside the tenant app.
Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
Hey π were you able to fix this?
No, I still haven't fixed it. I don't know if I will continue to use Filament with Stancl/Tenancy. I can't find a way to use Filament with both the central and tenant databases in Stancl. I've been trying to figure it out for almost a week, but I haven't had any luck yet.
by the way i am using multidatabases
I was able to fix it by heading over to the tenancy.php file in the config directory and set
asset_helper_tenancy
to falseoh nice i will try it. thanks
When i add the InitializeTenancyByDomain::class,
PreventAccessFromCentralDomains::class, i get error, "Tenant could not be identified on domain test"
Thanks i figure it out now, in panel middleware, the PreventAccessFromCentralDomains::class does not need,
Hasn't been published yet, but maybe this can help too. https://github.com/filamentphp/filamentphp.com/blob/821916a99f7398b00fb1700cf069d8b1bf0933a1/content/articles/multi-tenancy-implementation-with-multi-database-approach.md
GitHub
filamentphp.com/content/articles/multi-tenancy-implementation-with-...
Source code for the filamentphp.com website. Contribute to filamentphp/filamentphp.com development by creating an account on GitHub.
Nice nice, Ill check it out.
It's the same guide as mentioned above, right?
yep. sorry. missed the previous link. π