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.
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.
Your Eloquent models become OData entity types. Relationships become navigation properties. No mapping files. No configuration classes. The entity data model generates itself.
$filter, $expand, $select, $orderby, $top, $skip, $count — the full OData v4 query language, executed against your Eloquent models. Complex filters, nested expands, computed properties.
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.
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.
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.
Define OData function imports for domain-specific read operations. Type-safe parameters and return types. Resolved from the Laravel container with full dependency injection.
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.
composer require laravelui5/odatanamespace 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.
// 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 XMLFull OData v4 responses. Pagination. Metadata document. Service root. Everything a client needs.
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.
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.
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.
A standards-compliant, self-describing API with a machine-readable metadata document. Clients discover your schema, generate types, and query without documentation.
OData works independently. Install it today, use it forever, MIT licensed.
But it's also the data layer of the LaravelUi5 platform:
Each layer is optional. Each layer builds on the previous. Start with what you need.
No registration. No license key. No strings attached.