1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 05:14:04 +00:00
laravel-tips/content/tips/the-shouldcache-method-lets-you-cache-model-accessor-values.md
2022-04-17 20:03:34 +02:00

13 lines
No EOL
487 B
Markdown

---
title: 'The `shouldCache()` method lets you cache model accessor values'
tweet_id: '1515057389950537729'
thread_slug: weekly-thread-2022-15
author_username: cosmeescobedo
images:
- 'https://pbs.twimg.com/media/FQOpEt5VQA0OnWt.jpg'
created_at: 2022-04-15T20:00:04+00:00
slug: the-shouldcache-method-lets-you-cache-model-accessor-values
---
🔥 Laravel Tip: Accessor Caching
As of Laravel 9.6, if you have a computationally intensive accessor, you can use the shouldCache method.