When using global search in SPA mode with multi-tenancy after switching to a different tenant, the results are displayed from a previous tenant. I believe that global search component is not reloaded and still uses initial tenant scope.
In this video I am on Team 1 tenant. I type post in global search and observe This post is on Team 1 record. After switching to tenant Team 2 I type post in global search and still observe This post is on Team 1 record.
Expected behavior
I expected search to work the same as it does in non SPA mode. Switching tenant and using global search should correctly scope the query to new tenant.
Package
filament/filament
Package Version
v3.2.110
Laravel Version
v11.22.0
Livewire Version
v3.5.6
PHP Version
PHP 8.3.7
Problem description
When using global search in SPA mode with multi-tenancy after switching to a different tenant, the results are displayed from a previous tenant. I believe that global search component is not reloaded and still uses initial tenant scope.
https://github.com/user-attachments/assets/6ab988f1-c4ca-4467-a313-f97a0b45023b
In this video I am on
Team 1
tenant. I typepost
in global search and observeThis post is on Team 1
record. After switching to tenantTeam 2
I typepost
in global search and still observeThis post is on Team 1
record.Expected behavior
I expected search to work the same as it does in non SPA mode. Switching tenant and using global search should correctly scope the query to new tenant.
This is how it works in non SPA mode.
https://github.com/user-attachments/assets/59eb1104-409c-4886-8e2f-6e383b1cd0c4
Steps to reproduce
composer install
php artisan migrate --seed
/
route with the credentials: email -test@example.com
, password -password
post
in the global search barThis post is on Team 1
is visibleTeam 2
post
in the global search barThis post is on Team 1
is still visibleReproduction repository (issue will be closed if this is not valid)
https://github.com/Plytas/filament-spa-search
Relevant log output
No response
Donate 💰 to fund this issue