Skip to content
Join the Journey ⇢

Installation

The core package for this integration is laravelui5/core.

This provides the full foundation for:

  • SAP OpenUI5 Security Token Handling
  • Compatibility with Laravel's VerifyCsrfToken middleware
  • Clean separation of UI5, OData, and Laravel APIs
  • Automatic OData endpoint discovery per module
  • Environment-based transport configuration

Step I: Install the package

Get started by installing the LaravelUi5 Core package via Composer:

bash
composer require laravelui5/core

Once installed, you’re ready to move on to the next step.

Step II: Add the Service Provider

Register the Ui5CoreServiceProvider in your bootstrap/providers.php:

php
return [
    // ... other providers ...
    LaravelUi5\Core\Ui5CoreServiceProvider::class,
];

Step III: Configure middleware

In bootstrap/app.php, in the middleware section, add:

php
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use LaravelUi5\Core\Middleware\AuthenticateOData;
use LaravelUi5\Core\Middleware\FetchCsrfToken;
use LaravelUi5\Core\Middleware\ResolveUi5RuntimeContext;
use LaravelUi5\Core\Middleware\VerifyCsrfToken;

$middleware->alias([
    'auth.odata' => AuthenticateOData::class,
]);

$middleware->web(replace: [
    VerifyCsrfToken::class => VerifyCsrfToken::class,
]);

$middleware->appendToGroup('web', [
    FetchCsrfToken::class,
    ResolveUi5RuntimeContext::class,
]);

Step IV: Publish the configuration

Publish the UI5 configuration file:

php artisan vendor:publish --tag=ui5-config

This will create:

config/ui5.php

Step V: Configure Transport System Configuration

The configuration file config/ui5.php is published with a default system definition that reflects typical transport stages:

php
'systems' => [

    'DEV' => [
        'middleware' => [
            'web',
        ],
    ],

    'QS' => [
        'middleware' => [
            'web', 'auth.odata',
        ],
    ],

    'PRO' => [
        'middleware' => [
            'web', 'auth.odata',
        ],
    ],

],

To activate a system, set the SYSTEM environment variable in your .env file.

env
SYSTEM=DEV

This makes it easy to switch between development, QA, and production behavior, with no route or middleware changes.

Step VI: OData Integration (Built-in)

LaravelUi5 includes full OData v4.0 support out of the box. No manual setup required.

Once installed, your UI5 modules can expose typed, discoverable data services simply by extending Ui5App from Flat3\Lodata\Endpoint.

All service discovery, routing, and registration is handled automatically.

You’re now ready to define your first module and make Laravel speak UI5’s data language.

Released under the Apache 2.0 License.