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

Nats Laravel Package

repejota/nats

A Laravel/PHP client for NATS messaging that makes it easy to publish and subscribe to subjects, handle request/reply, and connect services with simple configuration. Suitable for lightweight microservices and plain PHP projects.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature scoping — adding an event bus to a PHP/Laravel product. If roadmap work requires domain events to leave the monolith (broadcast notifications, cache invalidation, webhook fan-out, cross-service state sync), this package is a low-cost way to put PHP on the NATS wire without adding a heavyweight broker client.
  • Architecture: event-driven vs. queue-driven. Supports an evaluation of NATS (at-most-once pub/sub, request/reply, queue groups) against Redis/Horizon, SQS, RabbitMQ, or Kafka. The decision this informs is whether the org standardizes on NATS as a lightweight, polyglot bus and needs PHP participation.
  • Build vs. buy vs. adopt. Writing a NATS client from scratch is protocol work with reconnect and subscription-management edge cases — non-differentiating. This package is the "adopt" option; a fork-and-maintain path is the fallback if we commit and it stalls.
  • Use-case fit: microservice fan-out between PHP and Go/Node services, request/reply RPC to non-PHP services, queue-group load balancing across PHP workers, telemetry/IoT ingestion, and real-time notification delivery where at-most-once semantics are acceptable.
  • Buy-in on an abstraction layer. The right product move is likely to wrap any client behind an internal EventBus interface, so this package becomes a swappable adapter rather than a lock-in. That decision should be made before adoption, not after.
  • Non-goals it clarifies: it does not support durable consumers, replay, ack semantics, or JetStream persistence — so it can't back work requiring at-least-once delivery or event sourcing.

When to Consider This Package

Consider it when:

  • You already operate NATS (or have committed to it) and need a minimal PHP producer/consumer to join the bus.
  • Core NATS is sufficient: fire-and-forget pub/sub, request/reply, and queue groups — no persistence requirements.
  • You want an MIT-licensed, dependency-light client you're willing to vendor, wrap, and potentially fork.
  • The workload is low-risk and internal (non-customer-facing, non-financial), and a small team owns the integration.
  • You're running a time-boxed spike to validate the architecture before standardizing.

Look elsewhere when:

  • You need JetStream (durable consumers, acks, replay, KV, object store) — evaluate basis-company/nats.php or another actively maintained client instead.
  • You need production-grade TLS, nkeys/JWT auth, cluster failover, or documented reconnect/backoff guarantees.
  • Community signal matters: 239 stars and 0 Packagist dependents is a weak signal for production hardening, security patching, and long-term maintenance. Treat this as a component you adopt and own.
  • You're Laravel-native and only need jobs/events — Horizon + Redis or SQS is lower total cost of ownership with first-party support.
  • You require SLAs, vendor support, or built-in observability.

Recommendation: conditional — approve a short spike behind an interface, with a benchmark and a side-by-side against a maintained alternative before any production commitment. Budget for a fork.

How to Pitch It (Stakeholders)

To executives: This is a small, MIT-licensed PHP client that lets our PHP services talk to NATS, a lightweight messaging system. Financially it's near-zero risk — no license fees, no vendor contract. Strategically it's a tactical component, not a bet: the project has limited community traction (0 known dependents), so if we adopt it we should expect to own it. The decision to fund is really about whether NATS is on our architecture roadmap; the client is the cheap part.

To engineering: Simple pub/sub, request/reply, and queue-group API over NATS's text protocol — easy to hide behind our own EventBus interface so it's swappable. Two caveats: it appears lightly maintained and lacks JetStream, so no durable delivery, replay, or ack semantics; and its auth/TLS story needs verification before we put it near production. Proposal: a one-week spike — wrap it in an adapter, benchmark throughput and reconnect behavior, and compare against a maintained alternative (e.g., basis-company/nats.php). If NATS is a keeper, plan to fork and pin; if not, the interface makes the swap a one-day change.

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator