Skip to content
Open Source

Read-only OData v4
for Laravel. Zero configuration.

Expose Eloquent models, raw SQL views, or custom objects as OData v4 endpoints. Queryable from UI5, SAP, or any standards-compliant client. With SAP vocabulary annotations and batch request support built in.

Why OData

Every Laravel project re-invents its API

You build the models. Then you build the controllers. Then the resources. Then the query logic. Filtering, sorting, pagination, eager loading. Then you document it. Then you maintain it.

For every project. Every time.

Meanwhile, the enterprise world has had a standard for this since 2007: OData. One protocol. One query language. Supported by every major platform.
SAP, Microsoft, Salesforce, and thousands of tools.

LaravelUi5/OData brings that standard to Laravel.

Capabilities

From Eloquent to OData in minutes

Automatic EDM Generation

Your Eloquent models become OData entity types. Relationships become navigation properties. No mapping files. No configuration classes. The entity data model generates itself.

Full Query Engine

$filter, $expand, $select, $orderby, $top, $skip, $count — the full OData v4 query language, executed against your Eloquent models. Complex filters, nested expands, computed properties.

Standards-Compliant

Any OData v4 client works out of the box. Connect UI5 apps, Excel pivot tables, Power BI dashboards, or SAP integrations without writing a single adapter.

Beyond Eloquent

Not every dataset is a model. Expose SQL views, aggregation queries, or joined result sets as OData entity sets with full query support. Declare columns and types, provide the SQL, and the engine handles $filter, $orderby, $top, $skip, $select, and $count automatically.

Three Tiers of Extensibility

Eloquent models. Auto-discovered, zero configuration.
SQL queries. Declare a schema, provide a query builder, get a full OData entity set.
Fully custom. Implement one interface for any data source: REST APIs, PHP computation, cross-model aggregation. Each tier builds on the previous; pick the one that fits.

OData Functions

Define OData function imports for domain-specific read operations. Type-safe parameters and return types. Resolved from the Laravel container with full dependency injection.

Laravel-Native. Read-only by design.

Respects your existing middleware, policies, and Eloquent scopes. OData lives inside your Laravel application, not beside it. No write operations, no ETags, no aggregation. A focused, reliable read layer that does one thing well.

Quickstart

Three steps. Real API.

1

Install

composer require laravelui5/odata
2

Define a service and discover your model

namespace App\OData;

use LaravelUi5\OData\ODataService;
use LaravelUi5\OData\Service\Contracts\EdmBuilderInterface;

class PartnerService extends ODataService
{
    public function serviceUri(): string  { return 'partners'; }
    public function namespace(): string   { return 'io.pragmatiqu.partners'; }

    protected function configure(EdmBuilderInterface $builder): EdmBuilderInterface
    {
        $this->discoverModel(Partner::class);

        return $builder->namespace($this->namespace());
    }
}

discoverModel() inspects the table, maps columns to OData properties, detects the primary key, and creates the entity set automatically.

3

Register and query

// config/odata.php
'service_registry' => App\OData\AppServiceRegistry::class,
GET /odata/partners/Partners              → entity collection
GET /odata/partners/Partners(1)           → single entity
GET /odata/partners/Partners?$filter=name eq 'Acme'
GET /odata/partners/Partners?$select=id,name&$top=10&$orderby=name
GET /odata/partners/$metadata             → CSDL XML

Full OData v4 responses. Pagination. Metadata document. Service root. Everything a client needs.

Use Cases

For anyone who needs a real API

Laravel developers

You already have the models. You just want an API that speaks a standard protocol instead of a hand-rolled REST layer. OData gives you query capabilities your frontend will love without building them yourself.

Enterprise integrators

Your clients run SAP or work in standards-driven environments. OData v4 is the protocol they already understand. LaravelUi5/OData makes your Laravel backend speak their language.

Teams building with UI5

OpenUI5's OData model is first-class. When your backend speaks OData natively, your UI5 frontend gets automatic binding, filtering, sorting, and pagination without an adapter layer.

API-first architectures

A standards-compliant, self-describing API with a machine-readable metadata document. Clients discover your schema, generate types, and query without documentation.

The LaravelUi5 Platform

Standalone or the foundation of something bigger

OData works independently. Install it today, use it forever, MIT licensed.

But it's also the data layer of the LaravelUi5 platform:

  • Add Core — your OData endpoints become part of a self-describing metadata architecture. Routes generate. Navigation builds. Structure emerges.
  • Add SDK — your metadata becomes a production SaaS runtime. LeanShell. Authentication. Authorization. Enterprise UX.

Each layer is optional. Each layer builds on the previous. Start with what you need.

ODataYou are hereMIT
CoreMetadata engineBSL 1.1
SDKProduction runtimeCommercial
Open Source

Open source. MIT licensed. Start now.

No registration. No license key. No strings attached.

OData: MIT | Core: BSL 1.1 | SDK: Commercial License