Laravel cache dependency

Posted 2 years ago by darkec

Hi In yii, we could use cache dependency. For example:

$sql = 'SELECT * FROM tbl_post LIMIT 20';
$dependency = new CDbCacheDependency('SELECT MAX(update_time) FROM tbl_post');  
$rows = Yii::app()->db->cache(1000, $dependency)->createCommand($sql)->queryAll();

And when query result be changed, the cache content will also change before expiration and then will send to output. How to do this job in the laravel? Is there any bundle for this task?

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up


Reply to

Use Markdown with GitHub-flavored code blocks.