Support the ongoing development of Laravel.io →
Eloquent Views Blade
Last updated 2 years ago.
0

there are two ways of doing this: (or that I can see)

  1. use caching.. (so when you do a query cache it for 5 or so minutes) - if you want fresh data or data changes significantly each second & taking account of that is required then obviously dont do this

  2. create a variable in that class, set it to null. create a method that checks if that var is null, if so does the query otherwise just returns that variable.. (will re-run the query on each page refresh)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

LonnyX lonnyx Joined 30 Mar 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.