Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Laravel Multi-Tenancy (Single Database): Tenant Scoping, Queues, Cache and Leak Tests

    1

    Build or audit tenant isolation in a shared-database Laravel 12/13 SaaS so no customer can see another customer's data.

    $3

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Laravel Multi-Tenancy (Single Database): Tenant Scoping, Queues, Cache and Leak Tests

    Laravel Multi-Tenancy (Single Database): Tenant Scoping, Queues, Cache and Leak Tests

    Example session with this skill installed

    Our Laravel 13 app has teams; users switch the current team. Audit it for cross-tenant leaks and add proper tenant scoping.

    • Read your context and instructions
    • Compiled the laravel multi-tenancy single

    Decision note (single database, team_id, current-team switcher) → findings table (e.g. Critical: InvoiceController uses DB::table('invoices') without team_id; High: SendReminder job loses the team) → CurrentTenant, ResolveTenant middleware, fail-closed TenantScope, BelongsToTenant trait, RequiresTenant job middleware → Pest isolation tests → completed leak checklist.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Most Laravel SaaS products keep every customer in one database, with a tenant_id (or team_id) on each row. It is simple and cheap, but it fails silently: one missing where clause, one queued job that lost its tenant, or one unprefixed cache key shows one customer's data to another.

    This skill gives your agent a repeatable procedure to:

    • Choose between a shared database and database-per-tenant, with a decision table.
    • Resolve and authorise the tenant in one middleware (subdomain, custom domain, path, API token or team switcher), ordered before route model binding.
    • Keep the current tenant in Laravel's Context as hidden data, so it follows queued jobs automatically.
    • Apply a fail-closed global scope and a BelongsToTenant trait that blocks writes for the wrong tenant.
    • Close the side doors: raw DB:: queries, unique/exists validation, cache, file storage, broadcast channels, scheduled tasks and unique jobs.
    • Prove isolation with two-tenant Pest tests and a read-only Python scan that flags models missing the trait.

    Output is either a full implementation (complete files plus a completed leak checklist) or an audit findings table ranked Critical to Low. Targets Laravel 12 and 13.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Focuses on single-database (shared table, tenant_id column) tenancy. For database-per-tenant or schema-per-tenant setups it only helps with the decision and points to dedicated packages. The scan script is a heuristic static check, not a proof of isolation.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    Software
    Laravel 12
    or13 project
    Optional
    Python 3.8+

    Python runs the read-only scan script.

    Permissions

    File Scopes

    Laravel
    project
    files
    (read;
    write
    only
    when
    asked
    to
    implement
    changes)

    The scan script is read-only and uses only the Python standard library.

    Listed14 days ago

    What's inside

    Frequently Asked Questions

    Build or audit tenant isolation in a shared-database Laravel 12/13 SaaS so no customer can see another customer's data.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Laravel Multi-Tenancy (Single Database): Tenant Scoping, Queues, Cache and Leak Tests on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in Security