filament/filament
v3.2
v11
No response
8.2
While preparing a video based on the official filament demo, noticed two queries running for the badge:
Debugged a bit deeper and discovered that the whole menu is being loaded twice.
Confirmed that I'm not alone, by two discussions opened by the same person:
But those discussions didn't lead to any issues opened, at least I haven't found, so creating one.
Made a bit of a source-dive. Managed to locate the problem but didn't manage to fix it.
Discovered that new NavigationManager()
is called twice: https://github.com/search?q=repo%3Afilamentphp%2Ffilament%20new%20NavigationManager&type=code
FilamentServiceProvider
HasRoutes
concernThere seems to be a check to prevent double-loading but for some reason it doesn't trigger for me:
if (! $this->isNavigationMounted) {
$this->mountNavigation();
}
P.S. Interesting part: during my testing, seems that the Cluster part of the menu (Products + Categories + Brands) is loaded only once, not twice. So there's some separate different logic for clusters, probably.
There should be one SQL query: either by not duplicating the query, or not duplicating the navigation manager call.
Just load the official demo locally and load any page with Laravel Debugbar and see the queries
https://github.com/filamentphp/demo
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too