ecommerce-tenancy

Implement and verify multi-tenant data isolation across Laravel stores.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/vinocrzy/StoreForge --skill ecommerce-tenancy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecommerce-tenancy
Source: https://github.com/vinocrzy/StoreForge/tree/main/.github/skills/ecommerce-tenancy
Command: npx skills add https://github.com/vinocrzy/StoreForge --skill ecommerce-tenancy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Multi-tenant data isolation for stores in a single database, ensuring each store's data remains private and protected from other stores. It reduces cross-tenant data leakage risks and simplifies governance for multi-store deployments.

Core Features & Use Cases

  • Global tenancy using a store_id to automatically scope all queries and models.
  • Tenant-aware models, controllers, and middleware to enforce isolation across the application.
  • Migrations, indexes, and relationships designed for per-store data segregation.
  • Use cases include onboarding new stores, building tenant-scoped resources (products, orders, customers), and performing isolation audits.

Quick Start

Set up a new store's tenant context and run the isolation tests to verify data separation.

Frequently Asked Questions about ecommerce-tenancy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce multi-tenant data isolation in a Laravel application?

Multi-tenant data isolation in a Laravel application is enforced by applying a global scope to automatically filter queries with a store_id column, preventing cross-tenant data leakage. This ensures models, controllers, and migrations segregate data per store.

What is the best way to automatically assign tenant context on model creation in Laravel?

Automatically assigning tenant context on model creation in Laravel is handled by automatically setting the store_id when new records are created. This ensures every newly created resource is immediately scoped to the correct tenant without manual intervention.

How does a global scope prevent cross-tenant data leakage in PHP applications?

A global scope prevents cross-tenant data leakage in PHP applications by automatically appending tenant filtering conditions to all database queries. This guarantees that queries only retrieve records matching the active tenant's store_id.

Can I use automated tenant scoping for existing Laravel migrations and databases?

Automated tenant scoping can be applied to existing Laravel migrations by adding a store_id column, necessary indexes, and designing relationships for per-store data segregation. This integrates tenant isolation into your current database structure.

How do I verify multi-tenant isolation and test for data leakage in Laravel?

Multi-tenant isolation is verified by running comprehensive tests that validate data separation and perform isolation audits across stores. These tests ensure that tenant scoping correctly prevents cross-tenant data access under various application contexts.