Question for #Laravel devs: how do you avoid duplicated queries when you're listing the same model in both nav & footer blade components?
0 reposts1 like
Question for #Laravel devs: how do you avoid duplicated queries when you're listing the same model in both nav & footer blade components?
0 reposts1 like
I think it's overkill for most apps, but you could use a singleton: gist.github.com/timvandijck/... Alternatively you can make the singleton class typed instead of generic with a getter/setter like I did.
An identity map would be the optimal solution for this problem. Too bad it's never going to land in Eloquent 😞 github.com/laravel/fram...