Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 740 Bytes

File metadata and controls

30 lines (21 loc) · 740 Bytes

marko/page-cache-entity

Bridge package that auto-purges page-cache tags when entities implementing IdentityInterface are saved or deleted.

Installation

composer require marko/page-cache-entity

Quick Example

use Marko\Database\Entity\Entity;
use Marko\PageCache\Contracts\IdentityInterface;

class Product extends Entity implements IdentityInterface
{
    public function getIdentities(): array
    {
        return ['products', "product-{$this->id}"];
    }
}

Saving or deleting the entity purges the listed cache tags automatically --- no extra wiring needed.

Documentation

Full usage, API reference, and examples: marko/page-cache-entity