Adding a record count alongside a navigation link
Hi could you point me to the feature that enables the display of the number of orders (in this case 193) shown in the attached?
I can see it's related to the number of "new" orders - just need to understand how the number gets put there. I have had a look at the source code on github and see the navigation title definition here Anyone able to point me to the documentation or the relevant file within github? thx j
I can see it's related to the number of "new" orders - just need to understand how the number gets put there. I have had a look at the source code on github and see the navigation title definition here Anyone able to point me to the documentation or the relevant file within github? thx j
7 Replies
Solution
This in your resource class if i'm correct
Yep:
If you take a peek into the Resource class itself, you'll find a lot of public methods that you can use
I made a post about navigation badges yesterday hopefully it helps;
https://x.com/CodeWithDennis/status/1848263961294041246
(Laravel v11.23 if you want to use Flexible)
CodeWithDennis (@CodeWithDennis) on X
Here's a handy trick for your @filamentphp count badges using @laravelphp flexible caching. If the cache is fresh, it's returned instantly. If stale, the old value is sent while the cache updates in the background. If expired, the value is recalculated.
Twitter
Thanks patrick, I was literally about to update this as I had found the solution within the resouce file on github.
Is this the resolution to the request discussed here https://github.com/filamentphp/filament/discussions/7221 ?
GitHub
refresh navigation badge · filamentphp filament · Discussion #7221
Table polling works fine, but how can I update the corresponding navigation badge so that they are in sync?
No.