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
Patrick
Patrick12mo ago
static::getModel()->count() ?
Luukd_2000
Luukd_2000OP12mo ago
this is not possible, it returns getModel cannot be called statically
Patrick
Patrick12mo ago
can you share the code
dwiser
dwiser12mo 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.

Did you find this page helpful?