getNavigationBadge on a managerelatedrecords page

Hello, I have a submenu with some custom ManageRelatedRecords pages. I would like to add a counter badge next to the navigation. The problem im getting is that static::getModel()::count(); cannot be called staticaly. How do I fix this?
4 Replies
Patrick1989
Patrick19894mo ago
static::getModel()->count() ?
Luukd_2000
Luukd_20004mo ago
this is not possible, it returns getModel cannot be called statically
Patrick1989
Patrick19894mo ago
can you share the code
dwiser
dwiser4mo ago
Sharing code would be helpful but I think you'd need either $this->getModel()->count() or (new static)->getModel()->count() depending on where you are and what the context is.