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
composer require laravelui5/odata
composer require laravelui5/chiron --dev # optional: guidelines for your coding agentThe 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
php artisan vendor:publish --provider="LaravelUi5\OData\ODataServiceProvider"This creates config/odata.php with sensible defaults.
Verify the installation
Start your Laravel development server:
php artisan serveVisit http://localhost:8000/odata in your browser. You should see an empty OData service document:
{
"@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:
| Key | Default | Purpose |
|---|---|---|
prefix | 'odata' | URL prefix for all OData routes |
register_routes | true | Whether the package registers its own routes |
middleware | [] | Middleware applied to OData routes |
streaming | true | Stream JSON responses (memory-efficient) |
namespace | 'io.pragmatiqu' | Default CSDL namespace |
version | '4.0' | OData protocol version |
service_registry | ODataServiceRegistry::class | Service router class |
read_authorizer | AllowAllReadAuthorizer::class | Per-actor read gating (default: allow all) |
pagination.max | null | Maximum page size (clamps client preference) |
pagination.default | 200 | Default page size |
See Configuration Reference for full details.