Landlord Theme Development
A landlord theme restyles the platform's own public site — the central
storefront rendered from core/resources/views/landlord/frontend/**: home,
blog, pricing and checkout, auth pages, the user dashboard, payment pages and
the docs plugin pages.
It is a separate system from the tenant themes described in Theme Development:
| Tenant theme | Landlord theme | |
|---|---|---|
| Location | core/themes/<slug>/ | core/landlord-themes/<slug>/ |
| Scope | One customer website | The whole platform (central site) |
| Activated by | tenants.theme_slug (per tenant) | landlord_theme_slug central option (one at a time) |
| Manifest | theme.json | landlord-theme.json |
| Resolution | themes.<slug>.frontend.* → fallbacks.frontend.* | landlord.frontend.* → core resources/views |
| Assets | assets/tenant/frontend/themes/… + theme routes | /landlord-theme-assets/<slug>/<path> |
| Admin page | Themes → All Themes (tenant catalog) | Themes → Landlord Site Theme |
| Checker | ThemeCompatibilityChecker | LandlordThemeCompatibilityChecker |
The two trees never overlap. Installing or activating a landlord theme cannot change a tenant website, and a tenant theme cannot change the platform site. With no landlord theme active the storefront renders core views exactly as before — the feature is purely additive.
Where landlord themes live
core/landlord-themes/<slug>/
├── landlord-theme.json # manifest (required)
├── views/landlord/frontend/… # only the files you override
│ ├── frontend-page-master.blade.php
│ ├── partials/header.blade.php
│ └── partials/footer.blade.php
├── assets/
│ ├── css/acme.css
│ ├── js/acme.js
│ └── img/…
├── screenshot/primary.jpeg # optional; card artwork
└── README.md
A copy-paste scaffold ships with the platform:
core/landlord-themes/_starter/— folders starting with_are ignored by discovery, so it can never be activated by accident.
How a view is resolved
At boot — after every provider has booted, so a plugin that registers a theme
in its own boot() is included — the active theme's views/ root is
prepended to Laravel's file view finder:
app('view')->getFinder()->prependLocation($themeViewRoot);
The consequences:
landlord.frontend.partials.headerresolves to the theme file when the theme ships it.- Every file the theme does not ship falls back to
core/resources/views/landlord/frontend/...automatically. Themes are overlays, not copies. - No controller, core view or plugin view needs to change.
- Plugin views that
@extends('landlord.frontend.frontend-page-master')or@extends('landlord.frontend.user.dashboard.user-master')— Documentation, DomainReseller, ToltAffiliate — are themed automatically.
For code that wants to be explicit:
return landlord_theme_view('landlord.frontend.blog.category', compact('all_blogs'));
landlord_theme_resolver() exposes the same lookup:
| Method | Returns |
|---|---|
viewRoot() | Absolute path prepended to the finder, or null for core |
paths() | Priority-ordered view roots (theme → filtered extras → core) |
themeFile('landlord.frontend.partials.header') | Absolute path or null |
hasOverride($view) | bool |
asset('css/acme.css') | Public URL or null |
assetUrls('css' | 'js') | Manifest asset URLs for the active theme |
Only Blade files under views/landlord/ are accepted in an uploaded package.
A theme can shadow the landlord storefront — never tenant views, admin screens
or shared x-ui.* components.
Page templates and datasets
A theme can ship complete pages, not only overrides. A file at
views/landlord/frontend/pages/<slug>.blade.php is rendered by the landlord
catch-all route for that slug — even when no Page row exists:
views/landlord/frontend/pages/features.blade.php → /features
views/landlord/frontend/pages/pricing.blade.php → /pricing
views/landlord/frontend/pages/about.blade.php → /about
Pages that need platform data declare it in the manifest and receive resolved variables, so the theme itself never queries the database:
"pages": {
"home": { "data": ["themes", "plans"] },
"templates": { "data": ["themes"] },
"pricing": { "data": ["plans"] },
"resources": { "data": ["posts"] },
"documentation": { "data": ["docs"] }
}
| Dataset | Variables | Source |
|---|---|---|
themes | $themes, $theme_categories | Published tenant themes + the manifest's template_categories map |
plans | $plans, $plan_types | Active price plans grouped by monthly / yearly / lifetime |
posts | $posts, $post_categories | Published landlord blog posts (paginated) |
docs | $docs_categories, $docs_articles | Documentation plugin categories and articles |
$page_post is always present (the Page row, or null for a theme-only
page). Extend the payload with the landlord_theme_page_data filter:
add_filter('landlord_theme_page_data', function (array $data, string $slug) {
if ($slug === 'pricing') {
$data['annual_discount'] = 20;
}
return $data;
}, 10, 2);
template_categories groups themes on /templates and the home page:
"template_categories": {
"construction": { "label": "Construction", "themes": ["construction", "construction-teal"] },
"hotels": { "label": "Hotels", "themes": ["hotel-booking"] }
}
core/landlord-themes/natting is a complete reference: 16 page templates
(home, features, templates, pricing, resources, documentation, about, contact,
affiliate, legal pages, login and registration), real themes/plans/posts/docs
data, and the full Natting design system in assets/css/natting.css.
Manifest contract
landlord-theme.json must be valid JSON at the theme root.
{
"slug": "acme",
"name": "Acme",
"version": "1.0.0",
"author": "Acme Inc",
"description": "Conversion-focused platform storefront.",
"scope": "landlord",
"origin": "third-party",
"assets": {
"css": ["css/acme.css"],
"js": ["js/acme.js"]
},
"tokens": {
"main-color-one": "#0ea5e9",
"main-color-one-rgb": "14, 165, 233"
}
}
| Key | Required | Notes |
|---|---|---|
slug | yes | Folder name, [A-Za-z0-9][A-Za-z0-9._-]* |
name | yes | Catalog title |
version | yes | Displayed on the card |
author | no | Displayed on the card |
description | no | Recommended |
scope | no | Documentation only; landlord is implied |
origin | no | core shows a “Core” badge; anything else “Third-party” |
assets.css / assets.js | no | Paths relative to the theme's assets/ |
tokens | no | CSS variable overrides (see below) |
A plugin can register a theme at runtime instead of shipping a package folder:
add_filter('landlord_themes', function (array $themes) {
$themes['acme'] = (object) [
'slug' => 'acme',
'name' => 'Acme',
'version' => '1.0.0',
'_path' => plugin_path('Acme').'/landlord-theme', // optional
'tokens' => ['main-color-one' => '#0ea5e9'],
];
return $themes;
}, 10);
Design tokens
The :root block that used to be inline in
landlord/frontend/partials/color-font-variable.blade.php is now produced by
landlord_theme_tokens_css(). It is layered:
- current site settings (
main_color_one,heading_color,heading_font_family, …) — the previous hardcoded defaults, - the active theme's manifest
tokens, apply_filters('landlord_theme_tokens', $tokens, $theme),apply_filters('landlord_theme_tokens_css', $css, $tokens).
add_filter('landlord_theme_tokens', function (array $tokens, ?object $theme) {
$tokens['main-color-one'] = '#0ea5e9';
$tokens['main-color-one-rgb'] = '14, 165, 233';
$tokens['radius-lg'] = '14px';
return $tokens;
}, 10, 2);
// Escape hatch: replace the whole block.
add_filter('landlord_theme_tokens_css', fn (string $css) => $css."\n:root{--acme-glow:0 0 24px rgba(14,165,233,.4)}");
Keys are the CSS variable names with or without the leading --. Anything the
previous inline block emitted (--main-color-one, --main-color-two,
--heading-color, --header-bg-color, --footer-bg-color,
--paragraph-color*, --heading-font, --body-font, …) is available.
Assets
Files under the theme's assets/ folder are served by the platform, never
copied into core/public/assets:
landlord_theme_asset('css/acme.css'); // → /landlord-theme-assets/acme/css/acme.css?v=…
landlord_theme_asset_urls('css'); // manifest + landlord_frontend_styles
landlord_theme_asset_urls('js'); // manifest + landlord_frontend_scripts
- Route:
landlord.theme.asset(/landlord-theme-assets/{slug}/{path}). - Response: correct MIME type,
Cache-Control: public, max-age=31536000, immutable,X-Content-Type-Options: nosniff. - Path traversal and symlink escapes are rejected (404).
- The header injects CSS assets after core styles; the footer injects JS
assets before
@yield('scripts').
Add third-party CSS/JS from a plugin with the filters instead of editing the manifest:
add_filter('landlord_frontend_styles', fn (array $urls) => array_merge($urls, [
asset('plugin-assets/acme.css'),
]));
Hook and filter surface
All landlord theme tags are registered in
App\Services\Hook\MandatoryHooks and covered by php artisan hook:audit.
The complete list is also in the
Hooks Reference.
Registry and resolver
| Tag | Type | Payload |
|---|---|---|
landlord_themes | filter | (array $themes) — register a manifest object |
landlord_theme_active_slug | filter | (?string $slug) — force a theme without writing the DB |
landlord_theme_view_paths | filter | (array $paths) — view roots in priority order |
landlord_theme_tokens | filter | (array $tokens, ?object $theme) |
landlord_theme_tokens_css | filter | (string $css, array $tokens) |
Chrome
| Tag | Type | Fires in |
|---|---|---|
landlord_frontend_html_attributes | filter | <html> — (string $attributes) |
landlord_frontend_body_class | filter | <body> — (string $classes) |
landlord_frontend_title | filter | <title> — (string $title, $page_post) |
landlord_frontend_meta | action | Header, before </head> |
landlord_frontend_styles | filter | Header CSS list — (array $urls) |
landlord_frontend_scripts | filter | Footer JS list — (array $urls) |
landlord_frontend_head / frontend_head | action | Before </head> |
landlord_frontend_header | action | After <body> |
landlord_frontend_before_navbar / landlord_frontend_after_navbar | action | Around the navbar |
landlord_frontend_nav_items | filter | Navbar <ul> HTML — (string $html, $menu) |
landlord_frontend_nav_actions | action | Navbar right column |
landlord_frontend_before_footer_widgets / landlord_frontend_after_footer_widgets | action | Around footer widgets |
landlord_frontend_footer_columns | filter | Footer widget row HTML |
landlord_frontend_footer / frontend_footer | action | Before </body> |
Content
| Tag | Type | Payload / location |
|---|---|---|
landlord_frontend_before_content / landlord_frontend_after_content | action | Around @yield('content') in every page |
landlord_frontend_page_title | filter | (string $title, $page_post) |
landlord_frontend_breadcrumb | filter | (array $crumbs, $page_post) — [['label' => …, 'url' => …], …] |
landlord_frontend_breadcrumb_html | filter | (string $html, array $crumbs) — non-empty replaces the markup |
landlord_frontend_home_before_sections / landlord_frontend_home_after_sections | action | frontend-home — ($page_post) |
landlord_frontend_blog_card | filter | (string $html, $post) — each card in category/search/tag listings |
landlord_frontend_blog_single_before / landlord_frontend_blog_single_after | action | Blog single — ($blog_post) |
Worked examples
// Add a status link to the main navigation without touching core.
add_filter('landlord_frontend_nav_items', function (string $html, $menu) {
return $html.'<li><a href="/status">'.__('Status').'</a></li>';
}, 10, 2);
// Announce a launch above the page content.
add_action('landlord_frontend_before_content', function () {
echo '<div class="alert alert-info">'.__('New pricing is live.').'</div>';
});
// Replace the breadcrumb with a schema-friendly version.
add_filter('landlord_frontend_breadcrumb_html', function (string $html, array $crumbs) {
if (empty($crumbs)) {
return $html;
}
return view('acme::breadcrumb', compact('crumbs'))->render();
}, 10, 2);
Page Builder compatibility
The theme layout and the Page Builder coexist. A Page row with
page_builder = 1 renders the builder content inside the themed layout
(header, footer, tokens, theme CSS/JS), and every registered landlord
widget/addon works unchanged — e.g. /pricing-plan, /all-templates and
/blogs on a default install.
Designed pages default to static. Switch any page to the builder in the
manifest:
{
"page_mode": "static",
"pages": {
"home": { "data": ["themes", "plans"], "mode": "auto" },
"features": { "mode": "static" },
"about": { "mode": "builder" }
}
}
| Mode | Behaviour |
|---|---|
static (default) | The designed template renders; builder content is ignored for that slug |
auto / builder | Builder content wins when the Page row is builder-driven; otherwise the designed template (or normal page content) is used |
frontend-home.blade.php receives $use_page_builder for the same decision.
The Natting theme ships page_mode: static; flip it to auto to edit the home
and pages in the builder instead of the designed templates. Refresh discovery
after editing the manifest (landlord_theme_manager()->clearCache(); a plain
cache:clear may not clear the file store discovery uses).
Themes are presentation-only and cannot register Page Builder widgets. To make
a bespoke design editable section-by-section, ship the widgets as a companion
plugin (BaseWidget subclasses) — the generic landlord widgets (header
slider, price plans, template grid, FAQ, newsletter, …) are already available
and inherit the theme's design tokens.
Reference addon plugin
core/plugins/NattingLandlord shows the pattern: 11 landlord widgets
(ntt_hero, ntt_features, ntt_templates, ntt_pricing, ntt_video,
ntt_faq, ntt_newsletter, ntt_page_hero, ntt_doc_topics,
ntt_doc_popular, ntt_cta_band) that render the theme's
landlord.frontend.sections.* partials, so the builder output is identical to
the designed page.
php artisan natting:seed-home # builder-driven home (home_page option)
php artisan natting:seed-home --no-activate
php artisan natting:seed-docs # builder-driven /documentation
The Natting theme ships pages.home.mode and pages.documentation.mode as
auto; the remaining designed pages stay on their theme templates until their
mode flips. Builder widgets render in the frontend with the theme layout, and
appear under the Theme category in the page-builder panel.
Build a theme in five steps
-
Copy the scaffold.
cp -R core/landlord-themes/_starter core/landlord-themes/acme -
Set the manifest. Change
slugtoacme, then add your CSS/JS and token overrides inlandlord-theme.json. -
Override only what changes. Copy a single core file into the theme:
mkdir -p core/landlord-themes/acme/views/landlord/frontend/partials cp core/resources/views/landlord/frontend/partials/header.blade.php \ core/landlord-themes/acme/views/landlord/frontend/partials/header.blade.phpKeep every
landlord_*hook call in the copy. The upload checker rejects a header/footer/layout that dropped them. -
Install and activate it. Landlord Admin → Themes → Landlord Site Theme → upload the zip (or FTP the folder into
core/landlord-themes/and runphp artisan cache:clear), then click Activate. -
Verify.
php artisan hook:audit --verbose php artisan view:clearVisit
/,/blog, a blog post,/view-plan/{id},/plan-order/{id},/loginand/user-home, in both LTR and RTL.
Installing, activating and resetting
Landlord Admin → Themes → Landlord Site Theme (/admin-home/site-theme,
routes landlord.admin.site.theme, .activate, .upload).
- Upload a
.zipcontaininglandlord-theme.json,views/landlord/**and optionallyassets/**andscreenshot/primary.*. - The Core Layout card is always present. Use Core Layout clears
landlord_theme_slugand returns the platform to core views. - Activation is platform-wide, one theme at a time.
- Discovery is cached (
landlord_theme_manager.discover, 60 s inlocal, 1 h otherwise). The admin actions and uploads invalidate it; a manual FTP drop needsphp artisan cache:clear.
Under the hood:
landlord_theme_manager()->discover(); // cached registry
landlord_theme_manager()->all(); // slug ⇒ manifest
landlord_theme_manager()->find('acme');
landlord_theme_manager()->active(); // ?object
landlord_theme_manager()->activeSlug(); // ?string
landlord_theme_manager()->activate('acme'); // true|false
landlord_theme_manager()->activate(null); // back to core
landlord_theme_manager()->screenshot('acme'); // ?string
landlord_theme_manager()->clearCache();
A stale or deleted slug falls back to the core layout instead of erroring. A broken registry/filter callback is reported and the storefront keeps rendering.
Package compatibility checks
App\Services\Upload\LandlordThemeCompatibilityChecker runs before a package
is written to core/landlord-themes/.
Errors (upload blocked):
landlord-theme.jsonmissing, unreadable or invalid JSON.- Missing
name,slugorversion; invalid slug. - Path traversal,
.env,vendor/,node_modules/,.git/. - PHP syntax errors in shipped
.phpfiles. - Any
.blade.phpoutsideviews/landlord/. DB::, the DB facade,Schema::, or route definitions (Route::get/post/group/resource/…) inside a template.- An overridden chrome file that dropped its mandatory hooks.
Warnings (install allowed):
- Folder name or zip filename disagreeing with
slug. - A theme with the same slug already installed (it is overwritten).
tokens/assetswith the wrong shape.- A copy of core that contains core's own model/controller reads (a theme copying the user dashboard legitimately does).
- Missing
screenshot/primary.*— the card falls back to an icon.
Mandatory hooks per overridden file:
| File | Must contain |
|---|---|
views/landlord/frontend/partials/header.blade.php | landlord_frontend_head, landlord_frontend_header |
views/landlord/frontend/partials/footer.blade.php | landlord_frontend_footer, frontend_footer |
views/landlord/frontend/frontend-page-master.blade.php | landlord_frontend_before_content, landlord_frontend_after_content |
views/landlord/frontend/user/dashboard/user-master.blade.php | landlord_user_dashboard_menu_items, landlord_user_dashboard_menu |
Debugging
# Theme registry and every emitter
php artisan hook:audit --verbose
# Confirm resolution without activating anything
php artisan tinker
>>> landlord_theme_resolver()->themeFile('landlord.frontend.partials.header');
>>> landlord_theme_resolver()->viewRoot();
# Force a theme for one request (does not touch the database)
php artisan tinker
>>> add_filter('landlord_theme_active_slug', fn () => 'natting');
Because resolution is a view-finder location, a stale compiled view is the
usual culprit after switching themes: run php artisan view:clear. Theme CSS
is versioned with ?v=<mtime> — hard-refresh the browser if a stylesheet
looks cached.
Prefer hooks and tokens over copying a whole template. A copied file stops
receiving core fixes: if a future release adds a hook to
partials/header.blade.php, your copy will not fire it until you re-sync.
Ship only the files you actually change.
See also
- Hooks Reference — every tag, landlord and tenant.
- Theme Development — tenant themes.
- Plugin Development — registering a landlord theme from a plugin.

