Duplicate navigationbadge query with multitenancy
Hey,
I'm using getNavigationFeature() in a FilamentPHP multitenancy app, like this:
While investigating with Laravel Debugbar, I noticed that the query runs for every tenant the user has access to, which seems unnecessary.
For example, if I, as a user, have access to 10 customers, each page load runs 10 queries to get the navigation badge for each customer—even though only the active tenant is displayed and needed. I also noticed that it queries navigation badges for another panel on each page load, leading to even more unnecessary queries.
Is there a way to ensure it only runs the query for the selected tenant and only within the same panel or is it a config issue on my end?
3 Replies
Hey,
I'm using getNavigationFeature() in a FilamentPHP multitenancy app, like this:
While investigating with Laravel Debugbar, I noticed that the query runs for every tenant the user has access to, which seems unnecessary.
For example, if I, as a user, have access to 10 customers, each page load runs 10 queries to get the navigation badge for each customer—even though only the active tenant is displayed and needed. I also noticed that it queries navigation badges for another panel on each page load, leading to even more unnecessary queries.
Is there a way to ensure it only runs the query for the selected tenant and only within the same panel?
Hey, is that issue was solved?
No, haven't found a fix for it