A Pro subscription is required to watch this lesson.

When you use Laravel's Cache class or facade, you also define a ttl, or time-to-live, that determines how long that item will remain cached for. You may have used a plain integer for this in the past. I'd like to show you a far better approach that will make your code easier to read and maintain.

Would you like to hear from Laracasts by email occasionally?