bonnier/context-laravel
Laravel service provider and middleware for registering a request context. Install via Composer, add the ContextServiceProvider in config/app.php, and enable the RegisterContext middleware in Http/Kernel.php to make context available across your app.
Adopt if:
Look elsewhere if:
spatie/laravel-multitenancy).For Executives: "This package lets us ship tenant-specific features faster by automating context management—think of it as ‘autopilot for multi-tenancy.’ Instead of writing custom middleware for every new region or feature flag, we’ll use a battle-tested pattern to isolate data, configs, and logic per tenant. This reduces dev time by 30%+ for SaaS expansions and keeps us compliant with global data laws without over-engineering."
For Engineering:
*"Context-Laravel gives us a lightweight, DI-friendly way to scope requests to tenants, locales, or user segments. It’s like Laravel’s built-in Auth but for everything—database queries, feature flags, even view overrides. We’d fork it for maintenance, but it’s a drop-in replacement for:
WHERE tenant_id = X in every model).if (context()->is('eu')) { ... }).How can I help you explore Laravel packages today?