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

zaber-dev/laravel-context

A lightweight Laravel package for managing shared application context. Store and retrieve contextual data such as request metadata, tenant details, or user settings across middleware, services, and views without passing it manually.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for cross-cutting context: This package is a credible "buy/adopt" candidate to replace bespoke correlation-ID, tenant, or request-context plumbing hand-threaded through jobs, listeners, and log channels.
  • Multi-tenancy roadmap: A single ambient context carried across models, queues, cache, storage, logging, events, routing, and validation reduces the number of places tenant scope can leak—directly supporting tenant-isolation and data-boundary work.
  • Observability and incident response: Propagating correlation/trace IDs into async work makes distributed tracing and log correlation a configuration concern rather than a refactor, enabling faster forensics features.
  • Audit and compliance features: Uniform context propagation supports per-request attribution in logs and events, useful for audit-trail and regulatory requirements.
  • Platform standardization: If multiple teams are hand-rolling context passing, adopting one framework-native mechanism standardizes conventions, code review criteria, and onboarding.

When to Consider This Package

Consider it when:

  • Queued jobs, events, or async workflows currently lose request/tenant/user context and IDs are being threaded manually through constructors or payloads.
  • You are implementing or hardening multi-tenant isolation and want tenant scope applied consistently across cache, storage, and data access.
  • You need correlation IDs spanning logs and events for tracing/incident response, and you are not already standardized on an APM that injects this.
  • You want a low-boilerplate, framework-native mechanism instead of a bespoke context singleton.

Look elsewhere or proceed cautiously when:

  • The application is small and single-tenant; the propagation surface adds conceptual weight for little payoff.
  • You already run a mature observability stack (e.g., OpenTelemetry) that owns context propagation end-to-end—assess for overlap before layering.
  • Maturity risk: v1.0.0 is the first stable release and the package appears early-stage/single-maintainer ("zaber-dev"). Verify test coverage, release cadence, and backward-compatibility/upgrade policy before depending on it.
  • You need context semantics beyond Laravel boundaries (cross-service, non-PHP workers); confirm interoperability or plan to bridge it.

How to Pitch It (Stakeholders)

Executives: This is a small, framework-native library that makes request context—tenant, user, and correlation ID—travel automatically through queues, caches, storage, logs, events, routing, and validation. It reduces a class of tenant-isolation and debugging incidents, shortens mean time to resolution, and supports audit and compliance needs without a platform rewrite. The cost is one dependency plus a convention, versus ongoing bespoke plumbing. The primary risk is project maturity; recommend a scoped pilot on a non-critical service before broad rollout.

Engineering: v1.0.0 is the first stable release of Laravel Context. It centralizes ambient execution context and propagates it across the framework's supported boundaries, replacing hand-threaded context in jobs and listeners and giving consistent context in logs and events. Adopt it to standardize context handling and cut boilerplate; evaluate against your existing tracing setup to avoid duplication, pin the dependency version, and review the upgrade policy given the project's early stage.

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