php - Getting / adding eloquent models to cache -


i've started dig laravel 5 , i'm "digging" it. (heh, heh, it? ... sorry.)

anyways. in code, noticed that, relationships, eloquent ton of queries retrieve said relationships, or load them. i'm attempting cache results of these relationships, (hopefully), can reduce number of queries down little, , instead pull cache.

in earlier versions of laravel, know possible run user::with('stuff')->remember(5)->get(), retrieve results , cache them automatically. however, seen under eloquent caching section in laravel's upgrade guide, that's no longer possible.

my question is, how should 1 go achieving model caching now? i'd cache either parent relations, or (preferably), individual models themselves, , check cache them before pulling. looked adding event listener queries via event::listen('illuminate.query') check cache before querying database, don't know how return result listener.

i feel i'm on right path here i'm missing something. advice or information super helpful, in advance.


Popular posts from this blog