Open jay7793 opened 6 years ago
Seriously - can someone please add some form of local caching to this package? It's crazy that something as simple as this:
<div id="voteTotal-{{$feature->id}}" data-score-{{$feature->id}}="{{$feature->countTotalVotes()}}">
{{$feature->countTotalVotes()}}
</div>
means two separate database calls because of the two calls to ->countTotalVotes()
It doesn't solve your problem fully (caching is more useful) but you could make the best of it by assigning the results to a variable to reuse (psudo code.. Can't remember if @php() is right).
@php($countTotalVotes = $feature->countTotalVotes() )
<div id="voteTotal-{{$feature->id}}" data-score-{{$feature->id}}="{{$countTotalVotes}}">
{{$countTotalVotes}}
</div>
Is it possible to use this?
Thank you.