Skip to content

Installation ​

Read-only by design

laravelui5/odata answers queries and never writes. POST is accepted only for a $batch of GET requests; PUT, PATCH, DELETE and any other POST are refused with 400 method_not_allowed. Writes stay in your application, where validation and business rules belong. With LaravelUi5 Core, a write is a Ui5Action.

Requirements ​

  • PHP 8.4 or higher
  • Laravel 11.0 or higher
  • PHP extensions: DOM, JSON, libxml, SimpleXML

Install via Composer ​

bash
composer require laravelui5/odata
composer require laravelui5/chiron --dev   # optional: guidelines for your coding agent

The package uses Laravel's auto-discovery, so the service provider is registered automatically.

The second line is optional and dev-only. laravelui5/chiron ships the guidelines and Agent Skills that Laravel Boost hands your coding agent, so it writes this engine instead of guessing at it. It takes one opt-in tick during php artisan boost:install — a scripted install takes nothing without it.

Publish the configuration ​

bash
php artisan vendor:publish --provider="LaravelUi5\OData\ODataServiceProvider"

This creates config/odata.php with sensible defaults.

Verify the installation ​

Start your Laravel development server:

bash
php artisan serve

Visit http://localhost:8000/odata in your browser. You should see an empty OData service document:

json
{
  "@odata.context": "http://localhost:8000/odata/$metadata",
  "value": []
}

The service document is empty because no entity sets have been registered yet. See Quickstart to define your first service.

Configuration overview ​

The published config/odata.php controls:

KeyDefaultPurpose
prefix'odata'URL prefix for all OData routes
register_routestrueWhether the package registers its own routes
middleware[]Middleware applied to OData routes
streamingtrueStream JSON responses (memory-efficient)
namespace'io.pragmatiqu'Default CSDL namespace
version'4.0'OData protocol version
service_registryODataServiceRegistry::classService router class
read_authorizerAllowAllReadAuthorizer::classPer-actor read gating (default: allow all)
pagination.maxnullMaximum page size (clamps client preference)
pagination.default200Default page size

See Configuration Reference for full details.