Skip to content
$ cd ../projects

// case study ยท Own product ยท SaaS ยท 2026

Tailor Shop SaaS

A multi-tenant SaaS for tailor shops. Each shop gets its own database and runs customers, body measurements, orders, fittings, fabric stock, payments, loans and reports, in English, Arabic or Kurdish.

Laravel 12Vue 3stancl/tenancyMySQLRedisSanctumTailwind CSSvue-i18n

๐Ÿ”’ Private codebase. Details are general, and code samples are simplified to show the patterns without proprietary logic.

Shop dashboard in Kurdish (RTL): order stats, module grid and a quick-access dock.
Customer loans: searchable, sortable table with column toggles, export and row actions.
Reports: date-range filters, stock KPIs, stock movement chart and CSV export.
tailor-dashboard.webp
Tailor Shop dashboard in Kurdish (right-to-left) with order stats and module tiles

Shop dashboard in Kurdish (RTL): order stats, module grid and a quick-access dock.

my role
Sole developer: product, backend, frontend and deployment
the problem
Tailor shops track measurements, orders and payments on paper, so orders run late, measurements get lost and debts go unpaid. The goal was one product many shops can sign up for, with each shop's data fully isolated.

Architecture

  1. Request
  2. auth:sanctum
  3. SetCurrentTenant
  4. EnforcePlanLimit
  5. Controller
  6. Tenant DB

Multi-tenant architecture

  • Database-per-tenant with stancl/tenancy: every shop's data lives in its own MySQL database, with tenant-specific migrations.
  • The tenant is resolved from the authenticated user (not the subdomain) in a SetCurrentTenant middleware, which also blocks suspended shops and expired subscriptions.
  • A TenantProvisioner creates each new shop and its first admin, shared by public self-signup and the super-admin panel.
  • SaaS plans (Free / Basic / Pro) are enforced by an EnforcePlanLimit middleware that caps orders, products, customers and users per shop.
  • A super-admin panel manages shops, plans and status, and an artisan command migrated existing single-database data into per-tenant databases.

Shop features

  • Customers with reusable measurement profiles and values.
  • Orders with items, per-item options and fittings, using either the shop's fabric or the customer's own.
  • Fabric stock tracked in centimetres, with stock movements and suppliers.
  • Payments, loans with repayments, and a reports dashboard with ApexCharts.
  • Scheduled notifications for orders due soon and overdue payments, shown in an in-app notification bell.
  • Per-shop roles and permissions, with access to each module delegated separately.

Frontend & localization

A Vue 3 SPA (Vue Router, Headless UI, Tailwind CSS v4) with light and dark themes and a choice of layouts. Everything is translated into English, Arabic and Central Kurdish (Sorani), with full right-to-left support for the local market.

The pattern, in code

app/Http/Middleware/SetCurrentTenant.php
public function handle(Request $request, Closure $next): Response
{
    $tenant = $request->user()?->tenant;

    if (! $tenant) {
        return ApiResponseHelper::forbidden('No shop is associated with this account.');
    }

    if ($tenant->subscriptionExpired()) {
        return ApiResponseHelper::forbidden('Your subscription has expired.',
            ['reason' => 'subscription_expired']);
    }

    // Switch the default DB connection to this shop's own database
    tenancy()->initialize($tenant);

    return $next($request);
}

Outcomes

  • One codebase serves many shops, and each shop's data is fully isolated.
  • Shops can sign up themselves and are on a trial plan right away.
  • Built for the local market: Kurdish, Arabic and English with right-to-left support.