Themes & Views

How WemX resolves views, and how to build client area, admin area, email and invoice themes.

WemX has four independently themeable surfaces:

SurfaceFolderSelected by
Client arearesources/client_area/{theme}/APP_THEME in .env
Admin arearesources/admin_area/{theme}/APP_ADMIN_THEME in .env
Emailsresources/email_templates/{theme}/Settings → Application → Default Email Theme (and per mass mail)
Invoice PDFsresources/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:

  1. Copy resources/client_area/default to resources/client_area/mytheme.

  2. Set APP_THEME=mytheme in .env and run php artisan config:clear.

  3. Change views, components and assets. Publish assets to public/assets/clientarea/mytheme with:

    php artisan vendor:publish --tag=client --force

    Reference assets with client_asset('css/app.css'), which adds a version query string for cache busting. Use admin_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:

FileRequiredPurpose
email.blade.php✓The HTML layout
text.blade.phpA custom plain-text part
theme.jsonname, description, and format ("markdown" or HTML)
resources/email_templates/brand/theme.json
{ "name": "Brand", "description": "Our branded layout." }
  • HTML themes receive $name, $body (rendered HTML, including any table), $text, $subject and $button (text, url).
  • Markdown themes ("format": "markdown") receive $name, $body (Markdown), $markdownTable and $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').

On this page