Support the ongoing development of Laravel.io →
Cache Database Eloquent
Last updated 2 weeks ago.
0
$users = User::with('info')->remember(10)->get();

or

$users = Cache::remember('users', 10, function() {
    $users = User::get();
    $users->load('info');
    return $users;
});
Last updated 2 weeks ago.
0

Sign in to participate in this thread!

Cloudways

Your banner here too?

tantam tantam tantam Joined 10 Feb 2014

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.