Themes & Views
How WemX resolves views, and how to build client area, admin area, email and invoice themes.
WemX has four independently themeable surfaces:
| Surface | Folder | Selected by |
|---|---|---|
| Client area | resources/client_area/{theme}/ | APP_THEME in .env |
| Admin area | resources/admin_area/{theme}/ | APP_ADMIN_THEME in .env |
| Emails | resources/email_templates/{theme}/ | Settings → Application → Default Email Theme (and per mass mail) |
| Invoice PDFs | resources/invoices/{theme}/ | Settings → Payments & Invoicing → Default Invoice Theme |
The in-app updater overwrites the bundled default themes. Build your customizations as a new theme folder rather than editing default, so updates don't erase them.
Client and admin themes
The active client theme is registered under the theme:: view namespace, and the admin theme under admin::. Core routes render views such as theme::dashboard.index or admin::orders.index, and components are used as <x-theme::button.primary> and <x-admin::form.input>.
To create a client theme:
-
Copy
resources/client_area/defaulttoresources/client_area/mytheme. -
Set
APP_THEME=mythemein.envand runphp artisan config:clear. -
Change views, components and assets. Publish assets to
public/assets/clientarea/mythemewith:php artisan vendor:publish --tag=client --forceReference assets with
client_asset('css/app.css'), which adds a version query string for cache busting. Useadmin_asset()in admin themes, and publish with--tag=admin.
A theme must provide every view the core routes render, so start from a full copy of default. Keep these in place:
- the
extensionElements()loops, so extension elements still render, - Livewire/Volt components and their
wire:bindings, which hold the business logic.
Overriding module views
client_view('tickets::tickets.index') looks for resources/client_area/{theme}/tickets/tickets/index.blade.php first, and only then falls back to the module's own view. This lets a theme restyle extensions without editing them. admin_view() works the same way for the admin area.
Email themes
An email theme is a folder in resources/email_templates/ with:
| File | Required | Purpose |
|---|---|---|
email.blade.php | ✓ | The HTML layout |
text.blade.php | A custom plain-text part | |
theme.json | name, description, and format ("markdown" or HTML) |
{ "name": "Brand", "description": "Our branded layout." }- HTML themes receive
$name,$body(rendered HTML, including any table),$text,$subjectand$button(text,url). - Markdown themes (
"format": "markdown") receive$name,$body(Markdown),$markdownTableand$button, and are rendered through Laravel's mail components.
New themes appear in the theme dropdowns automatically.
Invoice themes
An invoice theme is a folder in resources/invoices/ with an invoice.blade.php (required) and an optional theme.json (name, description). The view receives the $payment with its user.address, gatewayConfig and taxDetails loaded, and is rendered to PDF with DomPDF. Keep the layout print-friendly: inline CSS, simple tables, and no JavaScript or external fonts.
Translations
Core strings live in lang/{locale}/messages.php and are used as __('messages.key'). To add a language, copy lang/en to lang/{locale}, translate it, and enable the locale in config/languages.php (several common languages are already listed there, commented out). Extensions ship their own Lang/ folder, used as __('extension-id::messages.key').