How to show total count of related record on Manage Related Record tab badge ?
Count the related record and show ton the navigation badge like this.
12 Replies
On a relation manager you could do something like:
🤔
But I used
My bad, i was assuming that MRR would provide a similar method, but after some short digging, it turns out there is no similar method that would give simple access to the
$ownerRecord
🤔
You could maybe do something like:
But that is also not what you want, because that would just be the count of records as opposed to the $ownerRecords
count. So I don't know at the top of my hat how solve this, but im sure someone else knows 😂
There are methods to get the ownerRecord
but those are not static 🤔One solution is like
But this is not a good solution
Anyone have any Idea about this ?
This works. Why is it a bad solution?
The owner record is already there then why should we fetch again. Is there any way to get ownerRecrod, here the getOwnerRecord is not static.
Because the navigation is outside of the the page livewire component.
Which one is better to manage relation, MRR or RM ?
IMHO it doesn’t matter. It all gets processed at the same time.
I found that the RM have one extra query that's why I'm switching to MRR
Then navigation badge is separate to the the Lw component so they exist independently of each other.
Thank You @awcodes