Search by

osamaelnagar / oomycache-filament

OsamaElnaggar

Filament 5 bridge for OoMyCache: tenant-safe cache keys, Query Cache studio page and event-bypass invalidation.

Package info

github.com/OsamaElnagar/oomycache-filament

Homepage

pkg:composer/osamaelnagar/oomycache-filament

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.3 2026-11-11 14:06 UTC

README

OoMyCache Filament Bridge — Query Cache studio, tenant-safe cache keys and O(1) invalidation

OoMyCache Filament Bridge

Query Cache studio, tenant-safe cache keys, and event-bypass invalidation for Filament 5.
Optional bridge for the framework-agnostic osamaelnagar/oomycache package.

Latest version Total downloads Filament v5 PHP 8.3+ GitHub stars Tests MIT license

Filament 5 bridge for osamaelnagar/oomycache: a Query Cache studio for your panel, tenant-safe cache keys, and invalidation for Filament actions that bypass Eloquent model events.

OoMyCache core is framework-agnostic and works in any Laravel app. This bridge is optional — install it only when your app uses Filament.

What it adds

  • Tenant/panel-safe cache keys — binds a Filament-aware TenantResolver: the current panel id is part of every key; if a panel has tenancy and no tenant can be resolved, caching fails closed.
  • Query Cache studio page — configurable Query Cache navigation page with store status, cacheable models and their version tokens, live stats counters (when enabled), selective model invalidation and a global purge action. Filament-components-only markup, so custom panel themes apply unchanged. Set oomycache.filament.dashboard.navigation_label, .navigation_group and .navigation_sort to fit the host panel's navigation; the group defaults to the panel's default group.
  • Event-bypass invalidation — listens to Filament ActionCalled and flushes the affected models for associate/dissociate/reorder/import, bulk actions and non-cacheable models, which write through query builders / pivot tables without firing Eloquent model events. Standard per-record attach/detach/delete/force-delete/restore actions on cacheable models defer to core events so one logical write produces one invalidation.

Screenshots

OoMyCache Query Cache studio in light mode: cache status, hit/miss stats and cacheable models

OoMyCache Query Cache studio in dark mode

A Filament products table served from the OoMyCache query cache with zero ERP queries on a warm render

Installation

composer require osamaelnagar/oomycache osamaelnagar/oomycache-filament

Register the plugin on the panel(s) where the cache studio should appear:

use Oomycache\Filament\OomycachePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(OomycachePlugin::make());
}

Then publish the OoMyCache configuration (in the core package) and add the HasQueryCache trait to your models.

For AI agents (Laravel Boost)

The bridge ships a Laravel Boost skill at resources/boost/skills/oomycache-filament/SKILL.md covering plugin registration, the studio page, the deny-by-default can_purge gate, tenant resolver behaviour, and what Filament actions the invalidator covers. Package maintenance conventions live in AGENTS.md.

Requirements

  • PHP 8.3+
  • Laravel 12 / 13
  • Filament 5
  • OoMyCache core (osamaelnagar/oomycache)

Security

See SECURITY.md for supported versions and private vulnerability reporting. Do not open public issues for security reports.

Contributing

See CONTRIBUTING.md for setup, tests, release rules and bridge-specific constraints.

  • The studio page is only accessible to authenticated panel users; set oomycache.filament.dashboard.can_view to a Gate name to restrict it further.

  • Destructive actions are deny-by-default. Set oomycache.filament.dashboard.can_purge to a Gate name and define that gate for the operators who may invalidate/clear caches. Without it the buttons are hidden and the action closures refuse to run:

    // AppServiceProvider::boot()
    Gate::define('oomycache.purge', fn (User $user): bool => $user->is_admin);
    config(['oomycache.filament.dashboard.can_purge' => 'oomycache.purge']);
  • Purge/invalidate actions use the OoMyCache version-namespace API (O(1) token bumps) and never call Cache::flush() or Redis flushdb.

  • Tenancy fail-closed behaviour is inherited from the core TenantResolver contract.

  • Multi-tenant queue/console/API entrypoints: the bridge binds the Filament resolver only when no oomycache.tenant.resolver is configured. If your app resolves tenants outside panels (jobs, APIs), configure that resolver and make it return TenantContext::failClosed() when no tenant is known; otherwise those entrypoints run without tenant/panel segments.