Auto-Override System
Nazmart uses a file-based auto-override system. No PHP registration is required — simply place a file at the right path and it will automatically take priority over the default. This works the same way for all page types.
💡 ✅ Zero configuration needed Drop a file in the right location and it automatically overrides. The system scans your theme directory on every request activation.
Frontend Pages (theme:: namespace)
All frontend pages are resolved through the theme:: Blade namespace with a fallback chain. Any file you place inside themes/mytheme/views/ automatically overrides the same path in the default theme.
| Page | File to create in your theme | Blade namespace call |
|---|---|---|
| Shop listing | views/frontend/shop/all-products.blade.php | theme::frontend.shop.all-products |
| Product detail | views/frontend/shop/product_details/product-details.blade.php | theme::frontend.shop.product_details.product-details |
| Cart | views/frontend/shop/cart/cart.blade.php | theme::frontend.shop.cart.cart |
| Checkout | views/frontend/shop/checkout/checkout.blade.php | theme::frontend.shop.checkout.checkout |
| Navbar | views/header/navbar.blade.php | theme::header.navbar |
| Breadcrumb | views/header/breadcrumb.blade.php | theme::header.breadcrumb |
| Footer widgets | views/footer/widget-area.blade.php | theme::footer.widget-area |
| Contact page | views/frontend/pages/contact.blade.php | theme::frontend.pages.contact |
Module Pages (blog::, etc.)
Pages rendered by Laravel modules (Blog, etc.) use their own Blade namespaces like blog::. To override these, create files inside views/modules/{module-name}/. The system automatically prepends your theme's path to the module namespace.
| Page | File to create | Module namespace |
|---|---|---|
| Blog listing | views/modules/blog/tenant/frontend/blog/blog-all.blade.php | blog::tenant.frontend.blog.blog-all |
| Blog single | views/modules/blog/tenant/frontend/blog/blog-single.blade.php | blog::tenant.frontend.blog.blog-single |
| Blog category | views/modules/blog/tenant/frontend/blog/blog-category.blade.php | blog::tenant.frontend.blog.blog-category |
| Blog search | views/modules/blog/tenant/frontend/blog/blog-search.blade.php | blog::tenant.frontend.blog.blog-search |
ℹ️ ℹ How it works internally When a theme is activated, ThemeManager::registerModuleViewOverrides() scans themes/{slug}/views/modules/ and prepends each subdirectory to its matching module namespace using prependNamespace(). The finder cache is flushed so the change takes effect immediately.
Asset Pipeline
Theme assets are served as static files via a public symlink — no PHP involved on every request. This enables browser caching and CDN compatibility.
# Publish (symlink) your theme assets to public/
php artisan theme:publish mytheme
# Result:
# public/themes/mytheme/ → ../../themes/mytheme/assets/
In your theme.json, reference CSS and JS files by name (no path, no extension):
"headerHook": [{ "style": ["style", "pages"] }],
"footerHook": [{ "script": ["main"] }]
This loads public/themes/mytheme/css/style.css, pages.css, and main.js.
To reference assets inside a template, use the theme_asset() helper:
// In a blade template:
<img src="{{ theme_asset('img/logo.png') }}">
// Resolves to: /themes/mytheme/img/logo.png
// Falls back to: /themes/default/img/logo.png
Fallback Chain
View resolution follows a three-step fallback for the theme:: namespace:
- Active theme —
themes/{active-slug}/views/ - Default theme —
themes/default/views/ - Core tenant views —
core/resources/views/tenant/
This means your theme only needs to ship the files that are different. Everything else falls through to the default theme automatically.
💡 ✅ Ship only your overrides If your theme has a custom shop page but uses the default checkout, only create views/frontend/shop/all-products.blade.php. The checkout will fall through to the default theme automatically.

