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.

Reply to

Use Markdown with GitHub-flavored code blocks.