Skip to content

Backend Overview

LaravelUi5 bridges two ecosystems — Laravel and OpenUI5 — by providing a consistent artifact model that spans both worlds. Each UI5 module you create has a backend representation (PHP) and a frontend counterpart (JavaScript). This duality is managed through unified conventions and a set of Artisan tools.

Module Creation Strategies

LaravelUi5 supports both quick-start scaffolding for demos and structured integration of real-world UI5 projects.

Quick Start Modules

Here’s an example you’ll also see in our quickstart video:

bash
php artisan ui5:sca Users

This command creates a fully working example module under ui5/Users, including:

  • composer.json with package metadata
  • src/UsersModule.php defining the backend module entry point
  • src/UsersApp.php defining the backend app entry point
  • resources/app/ containing a UI5 frontend app
  • UsersServiceProvider.php to register the module

This entry point shows how easily a UI5 module can be wired into Laravel, without external setup.

It's ideal for:

  • demos and onboarding
  • simple internal tools
  • prototyping and experimentation

⚠️ Note: These modules are not meant to replace full-fledged UI5 projects. If you need TypeScript, test tooling, or advanced deployment pipelines, we recommend developing your UI5 app separately and integrating it via ui5:app or ui5:lib.

Production-Ready Module Imports

The commands ui5:app and ui5:lib are designed to import artifacts from existing UI5 source projects into your Laravel environment. They assume:

  • UI5 projects live outside the Laravel app (e.g. ../ui5-{domain}/)
  • LaravelUi5 pulls in a specific version snapshot of the source
  • Artifacts are placed under ui5/{Domain}/resources/ui5/
  • Matching backend integration (App class, Registry, ServiceProvider) is generated automatically

This is the recommended approach for integrating production-grade UI5 apps or libraries.

Conventions

The following conventions define how imported UI5 modules are structured, named, and integrated within the Laravel app.

Structure Conventions

In LaravelUi5, each UI5 application or library corresponds to exactly one domain.

Put differently: one app equals one module equals one source project.

This strict one-to-one relationship ensures clean boundaries and predictable integration.

The domain name you choose — for example, Users or Timesheet — determines the identity and structure of the module on all levels.

  • It defines the PHP namespace, which can be customized using the --php-ns-prefix option.
  • It sets the target folder under ui5/ inside the Laravel app, where the imported artifact will reside.
  • It controls the JavaScript namespace used for UI5 resolution, configurable via the --js-ns-prefix option.

This convention keeps both backend and frontend aligned, and ensures that all generated artifacts remain modular, versionable, and easy to reason about.

📝 Note The --js-ns-prefix option only applies when using ui5:sca to generate a new module from scratch. When importing existing projects via ui5:app or ui5:lib, the JavaScript namespace is read from the project's ui5.yaml file and cannot be overridden.

Filesystem Conventions

LaravelUi5 assumes a shared workspace where your Laravel app and all UI5 source projects live side by side:

plaintext
your-workspace/
├── laravel-app/               ← The deployable Laravel project
├── ui5-core-lib/              ← Source project for a UI5 library
├── ui5-offers/                ← Source project for a UI5 application
└── io.pragmatiqu.budget/      ← Folder structure as generated by Easy UI5

This layout is required and cannot be changed.

How It Works

  • UI5 source projects (like ui5-offers) are developed outside the Laravel project.
  • LaravelUi5 provides Artisan commands (ui5:app, ui5:lib) to import a snapshot of the UI5 artifacts into the Laravel app.
  • Imported artifacts are placed inside
plaintext
laravel-app/
└── ui5/
    └── Offers/
        └── resources/
            └── ui5/           ← Application or library source lives here

This makes UI5 artifacts available for:

  • Runtime serving via Laravel routes.
  • Integration with the registry and system config.
  • Deployment and packaging.

🛠️ This approach gives you the best of both worlds: full freedom during UI5 development and full control during Laravel deployment.

Artifact Hierarchy

LaravelUi5 provides a structured artifact model inside the Laravel app, where UI5 components from external projects are registered, organized, and integrated.

Versioning itself happens in the UI5 source projects. LaravelUi5 pulls in specific versions as needed and exposes them as modular artifacts.

At the core of this model is a clear hierarchy:

  • Modules act as containers. They group related artifacts under a common domain but are not addressable on their own.
  • Libraries typically reflect a one-to-one copy of an external UI5 library project. They provide shared UI logic across modules or apps.
  • Applications are the logical root for user-facing content. They often serve as the anchor point for subordinate artifacts like Cards, Reports, Tiles, and KPIs — which derive their context from the app but can be composed and displayed independently.
  • Dashboards are UI compositions that bring together Cards, Tiles, and KPIs into a cohesive interface. Dashboards are typically defined and rendered inside the Laravel project, and can be either static or dynamic.
  • Actions represent backend-only operations — such as toggling flags, triggering workflows, or executing custom logic. They are defined in Laravel and callable from UI5 via a unified API interface (LaravelUi5.call(...)), independent of any visual component.

This abstraction layer makes it easy to reason about complex UI5 landscapes while keeping everything modular and environment-aware.

Released under the Apache 2.0 License.