GDPR-compliant. CRMs. ERPs. System Integrations. More? Get in touch. 

Case Study

Subdomain-based multi-tenancy on Statamic CMS for scalable brand asset delivery

Complete Tenant Isolation

Subdomain-based multi-tenancy with strict data separation – each client gets a branded environment under a single Statamic installation

Production-Ready Infrastructure Handover

Tested multi-tenancy foundation with PHPUnit test suite and Git-based collaborative workflow – the client could continue working independently
„We approached Laramate with a very specific request, which the team was able to solve within a short time to our complete satisfaction. Even after the project was delivered, Laramate was very helpful with any questions and issues. We can recommend Laramate without reservation and look forward to working together again in the future.”
— Nicolas Rettinger

SchleeGleixner is a design agency that creates brand design, logos, and corporate identities for multiple clients simultaneously. To deliver this design work, the company needed a central platform where each client gets their own branded environment – without the overhead of managing multiple installations.

SchleeGleixner had already chosen Statamic and started the multi-tenancy architecture – but got stuck. Tenant isolation was incomplete, data was leaking between tenants, authentication was not properly scoped, and the debugging trail had gone cold. Switching platforms was not an option.”
2-month implementation
From analysis through implementation to production-ready handover with test suite and documentation
1 installation, many tenants
A single Statamic installation serves all clients in isolated, branded subdomain environments
PHPUnit test suite
Comprehensive tests validate tenant separation, auth scoping, and asset isolation as a safety net

The Challenge

SchleeGleixner uses Statamic CMS not as a traditional website, but as an internal operations platform – a design delivery system. Designers create structured workflows, upload assets, and present logos, brand materials, and color schemes as interactive deliverables. Each client gets their own subdomain (e.g. clientname.schlegleixner.com).

Missing Tenant Isolation

Data was leaking between tenants. Data separation was not fully implemented – a critical security risk for client data.

Auth Not Scoped

Authentication was not properly scoped to the respective tenant. Users could potentially access other environments.

Assets Not Isolated

Uploaded files like logos and brand materials were not properly separated by tenant – cross-tenant access was possible.

Eloquent Driver Not Tenant-Aware

Statamic's Eloquent Driver was not fully designed for multi-tenancy. Certain operations bypassed the tenant context entirely.

The Architecture

We implemented subdomain-based multi-tenancy with a single-database approach. The subdomain serves as the tenant identifier: middleware intercepts every request, resolves the tenant, and injects the context into the application container. All subsequent operations – database queries, file storage, authentication – inherit this tenant context.

Multitenancy with Statamic CMS and Eloquent Database Driver.
Subdomain Routing

Each client gets a branded subdomain. The root domain serves as the admin interface, while subdomains route to tenant-specific environments.

Single Database with Scoping

A central database with tenant_id on all relevant tables. Data separation through rigorous application-level scoping – secure and maintainable.

Isolated User Management

Separate authentication per tenant. Regular users are strictly isolated, only the super user can administer across tenants.

Asset Isolation

File paths are namespaced by tenant. Authenticated routes verify session, tenant membership, and asset ownership before every delivery.

The Technical Solution

The core of the problem was not in the application code, but in the Statamic Eloquent Driver. Certain methods – global variable management, asset handling, user management flows – bypassed the tenant context when reading or writing data.

Multi-tenancy bugs are often hidden in framework drivers, not in application code. With XDebug breakpoints at critical points – data writes, global variable access, asset storage – we were able to identify and fix the gaps in hours rather than days.”
XDebug Runtime Analysis

Breakpoints at critical points revealed exactly which driver methods weren't respecting the tenant scope. Runtime inspection instead of trial and error.

Driver Method Overrides

Identified methods were overridden to enforce tenant filtering. The Statamic Control Panel became fully tenant-aware.

PHPUnit Test Suite

Comprehensive tests validate: Tenant A cannot under any circumstances access Tenant B's data, users, or files. A safety net for future development.

DDEV Development Environment

Multi-subdomain structure replicated locally: clientA.ddev.site, clientB.ddev.site. Parity between development and production for reliable debugging.

Handover & Collaboration

This project was a pure infrastructure handover – no code deployment. The entire workflow ran through a private GitHub repository with collaborative access.

Git-Based Workflow

Private repository with incremental commits. The development team could trace, understand, and independently extend the implementation.

Functional Demo

Demonstration of complete tenant isolation: Tenant A and Tenant B as fully separate environments with isolated data, assets, and users.

Independent Further Development

The production-ready foundation with test suite enables SchleeGleixner to continue developing and scaling the system without external dependencies.

Technology Stack

The combination of Statamic as the CMS layer, Laravel as the foundation, and Stencil's tenancy package for multi-tenancy created a solid, extensible system.

Logomark
Statamic CMS

CMS with native Eloquent Driver for database-backed content storage. Form builder for structured design delivery workflows, tenant-aware Control Panel.

Logomark
Laravel Framework

Architectural foundation with Eloquent ORM, global scopes, subdomain routing, and middleware chains for tenant identification and isolation.

Stencil Tenancy Package

Superior subdomain routing customization compared to Spatie's package. Tenant-aware job traits for automatic scoping of queues and background processes.

Need a multi-tenant architecture?

  • Free initial consultation within 48 hours
  • Deep expertise in Statamic and Laravel multi-tenancy
  • Production-ready architectures with comprehensive test suites
  • Ongoing support and maintenance after go-live

Your contact person

chris.jpeg
Christian Wolf
Managing Director, PHP Developer
Thank you, we received your message and will contact you as soon as possible.
By submitting the form, you agree to the privacy policy. More info.