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

Simple Tenancy Laravel Package

sbine/simple-tenancy

Simple multi-tenancy for Laravel: add a trait to scope Eloquent models to the current tenant, with automatic query filtering and tenant-aware model creation. Lightweight and straightforward, it's ideal for apps that need clean tenant isolation without per-tenant databases.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: Best fit is a Laravel monolith or modular monolith using a shared database with row-level tenant isolation. It can be leveraged where Eloquent models, middleware, and request-scoped tenant resolution are standard. It is not a substitute for database-per-tenant, schema-per-tenant, or hard isolation required by regulated or enterprise customers.
  • Integration feasibility: MIT licensing and likely Composer installation reduce procurement friction. The small surface area makes a short spike and source review feasible. Actual effort depends on supported Laravel/PHP versions, tenant resolution mechanism, trait/global-scope behavior, and whether console, queue, and long-running worker contexts are covered.
  • Technical risk: Medium-high for production without validation. Low adoption (37 stars, score 0.335) implies limited community scrutiny and bus factor. The primary risk is cross-tenant leakage through unscoped Eloquent queries, raw SQL, withoutGlobalScopes, admin paths, queued jobs, commands, and long-running workers/Octane. Secondary risks include package abandonment, Laravel upgrade breakage, and incomplete cache/session/storage isolation.
  • Key questions: Which Laravel/PHP versions are supported? Is this single-database row-level tenancy only? How is the current tenant resolved and propagated? How are global scopes enforced and intentionally bypassed? Are jobs, commands, queues, events, notifications, and Octane handled? What migration/backfill pattern is expected? Is there a test suite proving cross-tenant isolation? Who maintains it and how active is the project? Can we vendor/fork under MIT? Are cache, filesystem, and search indexes tenant-aware?

Integration Approach

  • Stack fit: Good fit for conventional Laravel applications that can accept shared-database tenancy. Poor fit for multi-database tenancy, heterogeneous service estates, or customers requiring physical isolation. Treat it as an application-level enforcement aid, not a complete tenancy platform.
  • Migration path: Start with a non-production proof of concept on a representative module. Add the tenant model/table, add tenant_id to tenant-owned tables, backfill a default tenant, apply package traits/scopes to models, add middleware/resolver from authenticated user/domain, and wrap tenant context boundaries. Avoid a big-bang migration; phase by bounded context and keep a feature flag and rollback path.
  • Compatibility: Verify Composer constraints against the current Laravel/PHP baseline and CI matrix. Check conflicts with auth, policies, gates, caching, queues, sessions, filesystem, and observability. Add contract tests for cross-tenant access denial and tenant-context reset between requests and jobs. If constraints are stale, budget for a wrapper or fork.
  • Sequencing: 1) source/code review and maintainer check; 2) isolation spike with negative tests; 3) data model and backfill plan; 4) tenant resolution and middleware; 5) model enforcement rollout; 6) queue/console/Octane hardening; 7) security review and penetration-style tests; 8) staged production rollout with monitoring; 9) internal documentation and ownership. TPM should gate production on demonstrated cross-tenant isolation, not package installation.

Operational Impact

  • Maintenance: Low upstream activity and a small community mean internal ownership is required. Pin the version, monitor Laravel upgrades, and be prepared to vendor or fork. MIT is favorable, but maintenance cost shifts to the team.
  • Support: No commercial SLA or broad community support. Ramp-up includes reading source and writing internal runbooks. Support burden is highest during incidents involving suspected data leakage.
  • Scaling: Shared-database row-level tenancy can scale for many small tenants if tenant_id is indexed and query plans are monitored. Watch noisy-neighbor tenants, large-table growth, reporting queries, and future sharding needs. It does not provide strong isolation or per-tenant restore.
  • Failure modes: Missing tenant scope, incorrect tenant context in jobs/commands, scope bypasses, nullable or missing tenant_id, raw SQL, cache/session/storage key collisions, queue serialization of tenant context, long-running worker leakage, and package incompatibility after Laravel upgrades. The highest-severity failure is cross-tenant data exposure.
  • Ramp-up: Low-to-medium for Laravel developers because the package is described as simple and likely small. Medium for security and testing ownership because tenant isolation must be proven across HTTP, CLI, queues, and admin paths. TPM should budget a short spike plus dedicated negative testing before committing.
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.
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
noith/settings
kda/laravel-package