Skip to content

Ui5Module

Introduction

A Ui5Module is the top-level container for all UI5 artifacts belonging to a domain (e.g. Users, Timesheet, Portal). Each module wraps exactly one UI5 application or one UI5 library, plus that domain's subordinate artifacts and its platform integration (manifest scope, source strategy, auth boundary).

A module is a container, not an artifact — it implements Ui5ModuleInterface, not the artifact contract, and has no version or title of its own. Its identity is its namespace, which it reflects from its root artifact (see below).

App modules may define subordinate artifacts — cards, tiles, actions, resources, reports, dashboards. Libraries are intentionally lightweight and define none.

Identity — the module namespace

A module is keyed by its namespace (e.g. com.acme.portal): the dotted token that uniquely identifies it and becomes its URL segment (dots → slashes — /ui5/app/com/acme/portal@…).

The module does not declare its namespace. The root artifact (the App or Library) owns the NAMESPACE constant, and getNamespace() derives from it (getArtifactRoot()->getNamespace()) — so the module and its artifact share one source of truth and can never drift.

Lifecycle & Creation

Modules are not created explicitly. ui5:app / ui5:lib scaffold the module alongside its root artifact:

bash
php artisan ui5:app Users --create \
    --vendor="Acme GmbH" --php-ns-prefix=Acme --js-ns-prefix=com.acme --package-prefix=acme
# → UsersModule + UsersApp

php artisan ui5:lib Core --create --php-ns-prefix=Acme --js-ns-prefix=com.acme
# → CoreModule + CoreLibrary

The identity options carry your vendor's prefixes; ui5:app has no defaults for them — see App. plannedThe defaults are still in place; removing them is queued.

The name (Users, Core) sets the directory and class names; the namespace is written onto the artifact's NAMESPACE constant, read from the UI5 source project.

⚠️ A module contains an application or a library — never both. This is enforced by the architecture and reflected in the interface.

Artifact Composition

A module exposes its contents via Ui5ModuleInterface:

MethodReturns
getNamespace()the module's namespace (derived from the root artifact)
getArtifactRoot()the root — the App or the Library
getApp()the application, if present (getLibrary() for a library)
getCards()the module's cards
getTiles()the module's tiles
getCharts()the module's charts
getActions()state-changing API endpoints (POST/PATCH/DELETE)
getResources()read-only data endpoints
getReports()HTML report documents
getDashboards()dashboards
getDialogs()dialogs (an SDK-bound artifact type)
getValueHelps()value helps (an SDK-bound artifact type)
getAllArtifacts()the root plus every subordinate artifact
getSourceStrategy()how and from where the module's UI5 sources resolve
requiresAuth()whether the module requires an authenticated user

There is no getKpis() — analytic tiles are an SDK capability, not a Core module method.

Registration of Subordinate Artifacts

Subordinate artifacts must be explicitly registered inside the module class, in the matching getCards() / getReports() / … method. LaravelUi5 does not auto-register artifacts; each ui5:* generator prints a reminder:

💡 Don't forget to register this artifact in your module.

This keeps module structure under the developer's control and deterministic at runtime — an artifact exists only if it's intentionally exposed.

Module Registration

Business modules are declared in config/ui5.php under modules — a flat list of class strings:

php
'modules' => [
    \Acme\Sales\SalesModule::class,
    \Acme\Portal\PortalModule::class,
],

LaravelUi5 instantiates each and keys it by its getNamespace(). The namespace is the URL coordinate (dots → slashes) — there is no separate slug to assign. (Infrastructure modules — e.g. the SDK's auth and core modules — register themselves via the infrastructure marker; only business modules go in this list.)

⚠️ No automatic scanning. Explicit declaration keeps the system deterministic and deployment-friendly.

Summary

  • A Ui5Module is a container, not an artifact — the structural root for one domain's UI5 backend and frontend.
  • It wraps an application or a library — never both.
  • It is namespace-keyed; the namespace is owned by the root artifact and derived by the module (one source of truth).
  • Only app modules define subordinate artifacts, and registration is explicit.
  • Business modules are listed (class-only) in config/ui5.php; the namespace is the URL coordinate.

See Also