lawre17
Multitenancy with Spatie multitenancy package
Well first I know this has been discussed a lot here but I have a different approach I used in normal laravel project and It worked but I am getting problems trying to impliment it in filament v3*
How I did it in laravel:
I used spatie multitenancy package and used customr tenancy finder,
1.I have two user tables (dublication) in the landlord database and tenants database
2.when the user logs in we use the landlord connection and the users table which has tenant_id
3.laravel triggers a loginevent where I get the tenant_id and set the cookie and when the tenantFinder runs on request I just check for the cookie and set the current tenant.
My problem with Filament:
when user logs in the event from laravel side is not triggered hence the cookied is not set.
what I tried:
I tried setting the cookie using DispatchServingFilamentEvent if it is not set and it worked but later when you swicth the tenant the cookie remains and or is not cleared and or the tenantFinder for request runs before the login form is submitted causing NoCurrentTenant Exception:
How well can I modify Filament to work with my approach?
3 replies
How to access file(s) before submitting a form
In a table header action I have form that I want it to interact with an AI service.
The form entails an file upload and an action right below it.
When the action us trigger the file uploaded will be sent to the service and then use the response to fill other read only section of the form and now the form can be submitted.
I have tried using the $get() to access the file in the temporary storage but I am getting an associative array with a random key every time I uploaded an image.
Kindly assist, thank you.
7 replies