PHPackages                             coroq/with-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. coroq/with-cache

ActiveLibrary[Caching](/categories/caching)

coroq/with-cache
================

Simple, type-safe caching decorator trait

v1.0.0(5mo ago)00MITPHPPHP ^8.0

Since Dec 2Pushed 5mo agoCompare

[ Source](https://github.com/coroq-com/with-cache)[ Packagist](https://packagist.org/packages/coroq/with-cache)[ RSS](/packages/coroq-with-cache/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

coroq/with-cache
================

[](#coroqwith-cache)

A trait for building type-safe caching wrappers.

Requirements
------------

[](#requirements)

- PHP 8.0+
- PSR-6 cache implementation

Installation
------------

[](#installation)

```
composer require coroq/with-cache
```

Quick Start
-----------

[](#quick-start)

Create a caching decorator class that wraps your original class. When a method is called, the result is cached. Subsequent calls with the same arguments return the cached result without calling the origin.

```
