F
Filament14mo ago
skyrowl

Add stancl/tenancy to forms

Hey as filament admin is usable with tenancy through middleware, is there any way to do it with forms as well ? I didn't find anything in config files and Rich Editor attachments defaults to the central storage helper so it gives the wrong link
10 Replies
Dan Harrin
Dan Harrin14mo ago
what should it use instead of the storage facade
skyrowl
skyrowl14mo ago
I don't really know tho it's not using tenancy at all for attachment links even tho files are stored in the tenant folder it acts like this: Current Url of attachments: https://centraldomain.com/storage/attachments/----.png Url of tenant files: https://tenant.com/tenancy/assets/attachments/----.png Storage of the file: /storage/tenantX/app/public/attachments/----.png so the storage path is well identified but the url of the files are wrong and I don't really know from where it could come from :/
Dan Harrin
Dan Harrin14mo ago
i dont use the package so unless you can tell me specifics i cant help
skyrowl
skyrowl14mo ago
I don't really know how to explain better how it works than there sorry ... https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/#filesystem-tenancy-boostrapper storage_path() and asset() are made tenant aware and thus generate links with the tenant domain and overriden file path but in my case in the riche editor, links are generated using the central domain and central file path pattern so instead of giving me (tenant aware) https://tenant.local/tenancy/assets/attachments/uCe2QYvaP9j73yYu6TiUX5aqQUERdy9O93br1chH.png it gives https://central.local/storage/attachments/uCe2QYvaP9j73yYu6TiUX5aqQUERdy9O93br1chH.png I hope you can understand I'll try my best to elaborate further if you still need me to ^^'
Dan Harrin
Dan Harrin14mo ago
we use the storage facade, is it set up correctly according to the docs? https://tenancyforlaravel.com/docs/v3/tenancy-bootstrappers/#storage-facade
Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
Tenancy bootstrappers | Tenancy for Laravel
skyrowl
skyrowl14mo ago
Yes it is, I only have problems with this field, all the other components of the website using these helpers are working well Should've mentionned this page https://tenancyforlaravel.com/docs/v3/integrations/spatie When using spatie media we need to override the getUrl() method, it's probably the same problem here what do you think ?
Dan Harrin
Dan Harrin14mo ago
have a go, but it doesnt look like you are using spatie media library
skyrowl
skyrowl14mo ago
I do but I'm not sure it's possible with Rich Editor field, is it ?
Dan Harrin
Dan Harrin14mo ago
the rich editor doesnt use media library, no the urls you posted are not media library urls
skyrowl
skyrowl14mo ago
oh I'm sorry I was only referring to the alteration of urls in spatie media that should probably also be done in Rich Editor ?