osamaelnagar / oomycache-filament
Filament 5 bridge for OoMyCache: tenant-safe cache keys, Query Cache studio page and event-bypass invalidation.
Package info
github.com/OsamaElnagar/oomycache-filament
pkg:composer/osamaelnagar/oomycache-filament
Requires
- php: ^8.3
- filament/filament: ^5.0
- illuminate/support: ^12.0||^13.0
- livewire/livewire: ^4.0
- osamaelnagar/oomycache: dev-main || dev-master || ^0.1
Requires (Dev)
- larastan/larastan: ^3.9
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0||^11.0
- pestphp/pest: ^4.6||^5.0
- pestphp/pest-plugin-laravel: ^4.1||^5.0
- phpstan/extension-installer: ^1.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-10 21:59:46 UTC
README
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.
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 Cachenavigation 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. Setoomycache.filament.dashboard.navigation_label,.navigation_groupand.navigation_sortto fit the host panel's navigation; the group defaults to the panel's default group. - Event-bypass invalidation — listens to Filament
ActionCalledand flushes the affected models for attach/detach/associate/dissociate/reorder/import and all bulk actions, which write through query builders / pivot tables without firing Eloquent model events.
Screenshots
Installation
composer require osamaelnagar/oomycache:^0.1.0-alpha.1 osamaelnagar/oomycache-filament:^0.1.0-alpha.1
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
-
The studio page is only accessible to authenticated panel users; set
oomycache.filament.dashboard.can_viewto a Gate name to restrict it further. -
Destructive actions are deny-by-default. Set
oomycache.filament.dashboard.can_purgeto 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 Redisflushdb. -
Tenancy fail-closed behaviour is inherited from the core
TenantResolvercontract. -
Multi-tenant queue/console/API entrypoints: the bridge binds the Filament resolver only when no
oomycache.tenant.resolveris configured. If your app resolves tenants outside panels (jobs, APIs), configure that resolver and make it returnTenantContext::failClosed()when no tenant is known; otherwise those entrypoints run without tenant/panel segments.