Configuration Reference
The published configuration file is at config/odata.php.
Full configuration
php
<?php
return [
/*
|--------------------------------------------------------------------------
| Route Prefix
|--------------------------------------------------------------------------
|
| The URL prefix for all OData routes. All entity set, metadata, and
| batch requests are served under this prefix.
|
*/
'prefix' => env('ODATA_PREFIX', 'odata'),
/*
|--------------------------------------------------------------------------
| Register Routes
|--------------------------------------------------------------------------
|
| Whether the package registers its own routes. Set to false when a host
| application provides its own route group that re-uses the package's
| routes/odata.php with its own prefix and middleware.
|
*/
'register_routes' => true,
/*
|--------------------------------------------------------------------------
| Middleware
|--------------------------------------------------------------------------
|
| Middleware applied to all OData routes. Add authentication, CORS,
| rate limiting, or any other middleware here.
|
*/
'middleware' => [],
/*
|--------------------------------------------------------------------------
| Streaming
|--------------------------------------------------------------------------
|
| When true, JSON responses are streamed directly to the client. This
| reduces memory usage for large result sets. When false, responses
| are buffered in memory before sending.
|
*/
'streaming' => true,
/*
|--------------------------------------------------------------------------
| Default Namespace
|--------------------------------------------------------------------------
|
| The default XML namespace used in $metadata when a service does not
| override namespace().
|
*/
'namespace' => env('ODATA_NAMESPACE', 'io.pragmatiqu'),
/*
|--------------------------------------------------------------------------
| OData Version
|--------------------------------------------------------------------------
|
| The OData protocol version. Currently only '4.0' is supported.
|
*/
'version' => env('ODATA_VERSION', '4.0'),
/*
|--------------------------------------------------------------------------
| Service Registry
|--------------------------------------------------------------------------
|
| The class responsible for routing incoming requests to the appropriate
| ODataService subclass. The default serves a single service. Override
| with a custom implementation for multi-service setups.
|
*/
'service_registry' => LaravelUi5\OData\ODataServiceRegistry::class,
/*
|--------------------------------------------------------------------------
| Pagination
|--------------------------------------------------------------------------
|
| Server-driven pagination settings.
|
| 'default' — page size when the client does not send a Prefer header.
| 'max' — upper bound that clamps the client's odata.maxpagesize
| preference. Set to null for no upper bound.
|
*/
'pagination' => [
'max' => null,
'default' => 200,
],
];Environment variables
| Variable | Config Key | Default |
|---|---|---|
ODATA_PREFIX | odata.prefix | 'odata' |
ODATA_NAMESPACE | odata.namespace | 'com.example.odata' |
ODATA_VERSION | odata.version | '4.0' |