The way withBadge is displayed. #4322
Replies: 1 comment 2 replies
-
|
You can do the following: use Laravel\Nova\Badge;
Badge::$types['hidden'] = 'hidden';
// and assign `hidden` when badge value is 0.
return Badge::make(0, 'hidden'); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
OS | Windows NT (10.0 - build 18363 (Windows 10))
PHP Version | 8.0.3
Database | 5.7.24
Laravel Version | 9.14.1
Nova Version | 4.7.0 (Silver Surfer)
Description:
In menu section we can add withBadge trait and it will show the number (count method) of models based on the conditions we apply.
But what about situation we have no models to display following the conditions? We still see badge and number 0 displayed.
Is there any possibility to hide withBadge when there is nothing to show?
Beta Was this translation helpful? Give feedback.
All reactions