03.12.2015 Views

laravel4cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

API 138<br />

1 public function today()<br />

2 {<br />

3 return Event::where(DB::raw("DAY(started_at)"), date("d"))<br />

4 ->remember(15)<br />

5 ->get();<br />

6 }<br />

.<br />

This was extracted from app/controllers/EventController.php.<br />

…we just need to remember to add the remember() method before we call the get() or first()<br />

methods.<br />

.<br />

You can find out more about cache at: http://laravel.com/docs/cache.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!