Xgenious/ docs
Products
Get support

Theme Development Complete Guide

Nazmart Theme Developer Guide

Everything you need to build a fully independent, zero-core-change theme for the Nazmart multi-tenant ecommerce platform.

Introduction

Nazmart is a multi-tenant Laravel SaaS platform. Each tenant (shop owner) can activate a theme that controls the entire look and feel of their storefront. Themes live in a dedicated themes/ directory at the project root and are completely self-contained — no modifications to the core application are needed.

Key design principles:

  • Auto-override — place a file in the right path and it automatically overrides the default, no registration needed.
  • Fallback chain — if a theme doesn't provide a view, the system falls back to the default theme, then to core views. Themes only need to ship files that differ from the default.
  • Stable API — theme templates never import core classes or call raw routes. The Theme Helper API and Context API act as a stable contract layer.
  • WordPress-style template tags — typed wrapper objects with clean methods replace raw Eloquent models in templates.

Quick Start

1. Create your theme directory

mkdir -p themes/mytheme/views
mkdir -p themes/mytheme/assets/css
mkdir -p themes/mytheme/assets/js
mkdir -p themes/mytheme/assets/img
mkdir -p themes/mytheme/screenshot
mkdir -p themes/mytheme/demo

2. Create theme.json

themes/mytheme/theme.json

{
  "name": "My Theme",
  "slug": "mytheme",
  "version": "1.0.0",
  "description": "A beautiful food & restaurant theme",
  "niche": "restaurant",
  "status": true,
  "price": 0,
  "license": "free",
  "author": "Your Name",
  "headerHook": [
    {
      "style": ["style"],
      "rtl_style": [],
      "script": [],
      "blade": [],
      "navbarArea": "navbar",
      "breadcrumbArea": "breadcrumb",
      "loadCoreStyle": {}
    }
  ],
  "footerHook": [
    {
      "style": [],
      "script": ["main"],
      "blade": [],
      "widgetArea": "widget-area",
      "loadCoreScript": {}
    }
  ],
  "screenshot": [{ "primary": "screenshot.jpg" }]
}

3. Publish your assets

# Creates a symlink: public/themes/mytheme → ../../themes/mytheme/assets
php artisan theme:publish mytheme

4. Activate for a tenant

In the landlord admin panel → Themes, assign mytheme to a tenant. The system will automatically load your views and assets.

Directory Structure

themes/
├── _stubs/                    ← scaffold templates (copied by theme:create)
├── default/                   ← canonical fallback theme
│   ├── theme.json
│   ├── views/
│   │   ├── frontend/
│   │   │   ├── shop/
│   │   │   ├── pages/
│   │   │   └── partials/
│   │   ├── header/
│   │   └── footer/
│   └── assets/
│       ├── css/
│       └── js/
└── mytheme/               ← your theme
    ├── theme.json             ← required
    ├── views/
    │   ├── frontend/             ← overrides theme:: namespace
    │   │   ├── shop/
    │   │   │   ├── all-products.blade.php    ← shop listing
    │   │   │   ├── product_details/
    │   │   │   │   └── product-details.blade.php ← product detail
    │   │   │   ├── checkout/
    │   │   │   │   └── checkout.blade.php        ← checkout
    │   │   │   └── cart/
    │   │   │       └── cart.blade.php            ← cart
    │   │   └── pages/
    │   │       └── contact.blade.php         ← any static page
    │   ├── header/                   ← navbar, breadcrumb etc
    │   │   ├── navbar.blade.php
    │   │   └── breadcrumb.blade.php
    │   ├── footer/
    │   │   └── widget-area.blade.php
    │   └── modules/               ← module view overrides
    │       └── blog/               ← overrides blog:: namespace
    │           └── tenant/frontend/blog/
    │               ├── blog-all.blade.php    ← blog listing
    │               └── blog-single.blade.php ← blog detail
    ├── assets/
    │   ├── css/
    │   │   ├── style.css              ← main stylesheet
    │   │   └── rtl.css               ← RTL support (optional)
    │   └── js/
    │       └── main.js
    ├── Widgets/                  ← page builder widgets
    │   └── HeroSection.php
    ├── screenshot/
    │   └── screenshot.jpg
    └── demo/
        └── data.json             ← demo content import

theme.json Configuration

KeyTypeRequiredDescription
namestringDisplay name shown in admin panel
slugstringUnique identifier, matches directory name
versionstringSemantic version e.g. "1.0.0"
descriptionstringShort description for marketplace
nichestringCategory: restaurant, fashion, electronics
statusbooleanMust be true for tenant use
pricenumberMarketplace price (0 = free)
authorstringYour name / company
headerHookarrayCSS/JS files and blade areas for the header
footerHookarrayCSS/JS files and blade areas for the footer
screenshotarrayPrimary screenshot filename in screenshot/

headerHook properties

PropertyDescriptionExample
styleCSS files to load from assets/css/ (no extension)["style", "pages"]
rtl_styleRTL CSS files (loaded when RTL is active)["rtl"]
scriptJS files to load in <head> from assets/js/[]
bladeBlade partials to include in header hook slot["analytics"]
navbarAreaBlade file for the navbar (inside views/header/)"navbar"
breadcrumbAreaBlade file for breadcrumbs"breadcrumb"
loadCoreStyleObject to exclude specific core CSS files. Set key to false to skip.{"odometer": false}

footerHook properties

PropertyDescriptionExample
styleCSS files to load before[]
scriptJS files to load before from assets/js/["main"]
bladeBlade partials to include in footer hook slot[]
widgetAreaBlade file for the footer widget columns"widget-area"
loadCoreScriptExclude specific core JS. Set key to false to skip.{"odometer": false}

In this guide

Still stuck?
Our support team is ready to help you get set up.
Get support