An awesome feature that didn’t make it to the current documentation of Laravel 4, is caching within Eloquent models. So even caching the database results is done in just a single line of code, for example:
1 2 |
$articles = Article::with('comments')->remember(5)->get(); $articles = Article::remember(5)->get(); // works great! |