Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Permissions Redis Laravel Package

scabarcas/laravel-permissions-redis

A Laravel package that adds a Redis-backed permissions layer for fast authorization. Store and check roles and permissions with less database overhead, ideal for high-throughput apps needing quick access checks and simple integration with Laravel’s authorization ecosystem.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

The package targets a real, narrow inefficiency: Laravel's authorization path (Gate, policies, @can, middleware) resolves role/permission state per request, and most teams back that with Eloquent queries or a cache layer they hand-rolled. A Redis-native implementation is architecturally coherent with the typical Laravel production topology, where Redis is already present for sessions, queues, and cache. Fit is therefore high for greenfield services already treating Redis as tier-0 infrastructure, and moderate-to-low for shops where Redis is optional or single-node convenience infrastructure — this package promotes Redis from "nice to have" to a hard authorization dependency.

The critical architectural unknown is the data topology. Two very different products could live behind this description:

Model Implication
Redis as read-through cache in front of relational tables Low risk; a Redis outage degrades latency, not correctness
Redis as source of truth High risk; durability, eviction, and backup become authorization concerns

Until that is confirmed from source, assume the riskier reading and plan accordingly.

Integration feasibility

Effort is bimodal. A greenfield service can adopt in an afternoon: publish config, add a trait or resolver, wire a service provider, seed role data. Retrofitting an existing application is materially harder because authorization is a cross-cutting concern with many call sites — policies, Gate::before super-admin bypasses, Blade directives, form requests, API middleware, and any queued job that re-checks permissions. Every one of those must resolve through a single path or you get split-brain authorization, which is a security defect class rather than a bug.

The realistic integration cost is not the package; it is building a thin internal AuthorizationService façade so the vendor is swappable, plus a dual-write and shadow-read harness to prove parity before cutover.

Technical risk

Adoption signal is the dominant risk: 39 stars and zero dependents means effectively no production validation in the wild, no Stack Overflow corpus, and no community-derived edge-case hardening. This sits in direct competition with spatie/laravel-permission (~13k stars), which already ships a cache layer; the package's differentiation must be Redis-first storage or a meaningfully better read path, not merely "faster than Eloquent."

Additional risks:

  • Single-maintainer / bus factor 1. Zero dependents also means zero external contributors with commit incentive.
  • Release metadata anomaly. A last-release date of 2026-10-29 is in the future relative to any sane clock; treat the release feed as unreliable and verify tags, changelog, and CI status directly in the repo before pinning.
  • No published compatibility matrix for Laravel 11/12 and PHP 8.3/8.4, nor for predis vs phpredis. Laravel's Redis layer changed behavior across recent majors (serialization, PhpRedisConnector options, cluster support).
  • Coexistence hazard with an existing Spatie install: overlapping trait methods, table names, and Gate bootstrapping can silently shadow each other.
  • Dependency surface is unaudited; small packages are a common vector for stale transitive dependencies.

Key questions for the maintainer (or for source review)

  1. Is Redis the system of record or a derived cache? Where is the durable copy?
  2. What is the behavior when Redis is unreachable — fail-open, fail-closed, or fall back to DB? Is it configurable per route?
  3. How are permissions modeled per user — one key per user, hashes, sets? What is the memory profile at 100k users × 50 permissions?
  4. Does it support Spatie-parity features: teams/multi-tenancy, wildcard permissions, guard separation, super-admin bypass, policy integration?
  5. How is revocation propagated across app nodes, and what is the worst-case staleness window after a permission is removed?
  6. What is the recommended maxmemory-policy? (allkeys-lru would silently evict authorization data — an unacceptable default if Redis is the source of truth.)
  7. Is there a test suite, CI matrix, and static analysis? What is the stated BC/versioning policy?
  8. What is the cold-start/rebuild story after a flush or failover?

Integration Approach

Stack fit

Laravel 9–12, PHP 8.1+, Redis 6/7 via phpredis (preferred) or predis, coexisting with Horizon and standard queue/session/cache usage. Best fit: read-heavy APIs or BFFs with high authorization QPS and modest write rates to roles — the exact profile where per-request DB authorization shows up in p99. Poor fit: low-traffic internal apps (no benefit, added dependency), or regulated environments requiring auditable relational authorization state.

Migration path

Do not rip and replace. Use a parallel-run migration:

  1. Spike in a non-production environment; benchmark against the current implementation with realistic permission cardinality, not a 3-user fixture.
  2. Abstract all authorization reads and writes behind an internal service interface so the package is an implementation detail, not a framework-wide dependency.
  3. Dual-write — keep the existing source of truth authoritative for writes, mirror to Redis; read from the existing path.
  4. Shadow-read — read both, log divergences, hold the primary path as the answer. Require a clean divergence window (days, not hours) before proceeding.
  5. Flagged cutover on read paths by cohort — internal users first, then a small tenant, then broad.
  6. Decommission the legacy read path only after a full revocation-latency cycle has been observed in production.

Compatibility

If an existing spatie/laravel-permission install is present, plan for replacement, not composition. Verify trait method collisions, config key overlaps, and Gate::before ordering in a scratch branch before committing to either path. Also validate the package against the exact Laravel minor in use — a small package is unlikely to have tested your combination.

Sequencing and effort shape

Phase Work TPM read
Spike Source review + benchmark 2–5 days; the go/no-go gate
Façade Internal authz interface 1–2 weeks, reusable regardless of vendor
Dual-write + shadow Parity harness, dashboards 1–2 weeks
Canary Flag rollout, revocation drill 1–2 weeks
Steady state Runbook, alerting Ongoing

Roughly 4–6 engineer-weeks for a team with an existing authorization layer; substantially less for greenfield.

Operational Impact

Maintenance

Bus factor 1 with no commercial backing. The defensible posture is: pin an exact version, disable unattended dependency updates for this package, vendor or fork it into your monorepo if it becomes load-bearing, and assign a named internal owner. Budget for the possibility that you maintain the fork yourself within 12 months — that is the realistic cost of adopting a 39-star package into an authorization path.

Support

No SLA, no vendor escalation, no paid tier. Issue response is best-effort. Any incident involving this package is resolved by your team reading source. That is acceptable for a cache-shaped concern; it is a poor fit for a security-critical control plane unless you have forked it.

Scaling

The upside is real: authorization becomes an O(1) Redis round trip, removing a join-heavy query from every request. The costs:

  • Latency budget. Redis is now in the critical path of every authorized request. Cross-AZ hops, connection pool exhaustion, and cluster slot contention become authorization outages, not slowdowns.
  • Hot keys. Per-user keys are fine; per-role or global permission sets become hot keys under high fan-out on Redis Cluster.
  • Cardinality. Memory grows linearly with users × permissions. Get the sizing model before rollout, not after.
  • Cold start. A flush or failover triggers a rebuild storm; the rebuild path must be rate-limited or you will DDoS your own database.
  • Noisy neighbors. Shared Redis instances put sessions, queues, and authorization in one blast radius. Strongly consider a dedicated logical database or instance.

Failure modes

Failure Consequence Mitigation
Redis unavailable All authorization decisions fail Explicit fail-open/fail-closed policy; fail-closed on writes, never fail-open on privileged routes
maxmemory eviction Silent permission loss — users gain or lose access unpredictably noeviction or a dedicated instance; monitor evicted keys
Stale read after revocation Revoked user retains access until TTL/refresh Bounded revocation SLO; publish invalidation on role change; test the drill
Cluster failover / split-brain Divergent permission state across nodes Require replicated topology with documented consistency behavior
Flush or restart Empty permission set → mass denial or mass grant Warm-up on boot; treat empty state as an error, not as "no permissions"
Dual-write drift during migration Two systems disagree; intermittent, hard-to-reproduce bugs Shadow-read divergence alerting before cutover

The two failure modes that should gate adoption are revocation staleness (a security incident, not an outage) and fail-open under Redis loss (privilege escalation). Both must have written, tested answers before this touches production.

Ramp-up

Low for a Laravel developer — the mental model is familiar and the surface is small. Medium-to-high for on-call, because authorization failures present as scattered 403s, mysterious UI differences, and "works for me" reports rather than as a clean alarm. Required before launch:

  • Dashboards for authz hit rate, p99 latency, and deny-rate anomaly (a spike in denials is often a Redis problem, not a user problem).
  • An alert on Redis unavailability mapped explicitly to "authorization degraded."
  • A runbook covering flush recovery, revocation drill, and fail-open/fail-closed toggle.
  • A load test at realistic permission cardinality.

Overall TPM verdict: conditional adopt, not a default recommendation. The opportunity score (12.79) reflects a crowded space where the incumbent already offers caching and 300× the adoption. This package is defensible for a read-heavy service where authorization latency is a measured, named problem — and where the team is willing to own the fork and write down the failure policy. For a team evaluating it as a drop-in Spatie replacement, the answer is no: zero dependents and an unverified release feed are disqualifying for a security-critical path without a source review and a parallel-run migration.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox