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 Nemesis Laravel Package

andydefer/laravel-nemesis

Laravel Nemesis is a lightweight Laravel package by andydefer that installs via Composer and registers through a service provider, adding configurable functionality to your app. Early-stage project with limited adoption—check the source and docs before production use.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. Nemesis is a conventional Laravel package: a service provider (with middleware auto-registration), a nemesis middleware alias, publishable config/migrations, and a full Artisan command surface (create, reset, block/unblock, list). That is a low-friction fit for any Laravel HTTP/API codebase — it sits in the request pipeline alongside existing auth and does not require changes to controllers or route definitions beyond attaching the middleware. The domain-scoped token model (a token belongs to a domain, with per-token CORS and quotas) implies a centralised token table plus a per-request counter, which is a standard and reviewable design.

Integration feasibility. Feasible in days, not weeks, for a team already on Laravel. The v1.0.0 feature set covers the minimum viable surface for an internal or partner-facing API gateway concern: token issuance, per-domain isolation, CORS, quota enforcement, and operator tooling. Automatic middleware registration and optimised uninstall/cleanup reduce the cost of a trial — we can install, evaluate, and back out without residue.

Technical risk. Several risks are material at this stage:

  • First stable release, single maintainer. v1.0.0 under MIT by one author, with no evidence in the notes of test coverage, CI, static analysis, or a security disclosure process. Bus factor is the dominant risk.
  • Token extraction from query params. Supporting ?token= in addition to the Authorization header is convenient but causes credentials to land in access logs, proxy logs, browser history, and referrer headers. This should be opt-in and disabled by default for anything externally exposed.
  • Quota counter hot row. "Optimised counter increment" signals that concurrent writes were a known issue. Whether the fix is atomic (single UPDATE ... SET counter = counter + 1) or still read-modify-write determines whether quotas are accurate under load.
  • Fail-open vs fail-closed. The notes do not state what happens when the quota store is unavailable — the middleware either blocks all traffic or silently permits it. Both are wrong by default; it must be explicit and configurable.
  • Per-token CORS is powerful and easy to misconfigure; header emission from middleware rather than the standard Laravel CORS stack risks conflicting with existing config.
  • Documentation is French-only, which raises onboarding and audit friction for English-speaking engineers and external assessors.

Key questions.

  1. Which Laravel and PHP versions are supported, and is there a stated support window?
  2. Is token storage hashed at rest, or plaintext in the database?
  3. Is the quota increment atomic? What is the storage backend (DB only, or cache/Redis)?
  4. Is query-param token extraction default-on? Can it be disabled?
  5. Behaviour when the quota store is unreachable — fail-open or fail-closed?
  6. Does it compose with Sanctum/Passport, or is it positioned as a replacement?
  7. Test coverage, CI status, and a security contact for disclosure?
  8. Is there a versioning/compatibility policy now that 1.0.0 exists?

Integration Approach

Stack fit. Best suited to Laravel APIs with many machine clients partitioned by domain or tenant, where the need is coarse-grained call quotas plus simple token lifecycle — internal service-to-service, partner integrations, trial/sandbox tiers. It is a poor fit where OAuth2 scopes, delegated user consent, or token rotation with refresh flows are required; Sanctum or Passport remain the right answer there, with Nemesis layered on top purely for quota and domain policy.

Migration path. Treat as additive, not a replacement. Publish config and migrations, run them in a non-production environment first, register the middleware on a single low-risk route group, then issue tokens through Artisan. Existing authentication stays in place; Nemesis is inserted as an authorisation/quota gate after identity is established. This keeps rollback to "remove middleware from the route group" rather than "re-architect auth".

Compatibility. Verify against our pinned Laravel/PHP matrix before commitment — this is the single gating check. Also verify coexistence with any existing CORS middleware (avoid duplicate Access-Control-* headers) and with any global rate limiter, since two independent quota systems will produce confusing 429s.

Sequencing.

  1. Week 1 — Due diligence: resolve the key questions above; read the source for the counter increment, token storage, and query-param handling.
  2. Week 2 — Sandbox: install in staging, publish config/migrations, seed tokens, exercise all five Artisan commands, validate CORS headers and 429 behaviour under a load test with concurrent requests.
  3. Week 3 — Pilot: one non-critical, internally consumed API. Instrument quota rejections before enforcing.
  4. Week 4+ — Broaden: roll out per domain, with a documented runbook and scheduled quota resets in place before enforcement becomes user-visible.
  5. Contingency: confirm the fork-and-maintain path is viable (MIT permits it) and record it as the exit plan.

Operational Impact

Maintenance. Low day-to-day effort — the package is self-contained, migrations are reversible, and cleanup/uninstall is explicitly handled. The real maintenance exposure is upstream: one maintainer, no stated release cadence, and a major-version boundary just crossed. Pin the version exactly, avoid ^1.0 drift on a first stable, and budget for the possibility of vendoring or forking within 12 months.

Support. Documentation is French-only and appears to be release-note-led rather than reference-led. Internal enablement will need a short English runbook covering token issuance, quota reset scheduling, block/unblock, and the interpretation of nemesis:list output. There is no stated community, SLA, or security disclosure channel — assume self-support.

Scaling. The per-request counter write is the scaling ceiling. At high request volume against a shared relational table, row contention and write amplification will show up as latency on every protected call. Confirm whether the counter can be backed by Redis or an atomic increment before applying this to high-throughput endpoints; otherwise reserve it for moderate-volume domains. The token table itself will stay small and is not a concern.

Failure modes.

  • Quota store unavailable — unknown fail-open/fail-closed behaviour; must be validated and configured deliberately, with alerting on rejected-request spikes.
  • Counter drift from non-atomic increments — under-counting lets clients exceed quotas silently; over-counting blocks legitimate traffic. Load-test concurrency explicitly.
  • CORS misconfiguration per token — a single wrong origin can either expose an API or break an integration; changes should go through review, not ad-hoc Artisan calls.
  • Token leakage via query params — if enabled, tokens will appear in logs and monitoring tooling; either disable it or scrub query strings at the ingress.
  • Forgotten quota resets — blocked tokens stay blocked. Without a scheduled reset, clients fail permanently and the incident looks like an outage; the reset job is a hard prerequisite, not a nice-to-have.
  • Uninstall residue — the notes claim optimised cleanup, but verify that migrations, config, and the middleware alias are removed cleanly so an abandoned trial leaves no trace.

Ramp-up. Low for Laravel developers — the middleware-plus-Artisan pattern is idiomatic and needs little explanation. The ramp-up cost sits with operations and security review, not engineering: writing the runbook, defining the quota reset schedule, deciding query-param policy, and validating the fail-open/closed posture. Estimate one engineer-week of combined diligence and pilot work before production enforcement.

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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
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