Skip to content

Installation

Requirements

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

Install via Composer

bash
composer require laravelui5/odata

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

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
middleware[]Middleware applied to OData routes
streamingtrueStream JSON responses (memory-efficient)
namespace'com.example.odata'Default CSDL namespace
version'4.0'OData protocol version
service_registryODataServiceRegistry::classService router class
pagination.maxnullMaximum page size (clamps client preference)
pagination.default200Default page size

See Configuration Reference for full details.

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