Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Odata Client

Odata Client Laravel Package

saintsystems/odata-client

A fluent PHP client for calling OData REST services, inspired by Laravel’s Query Builder. Install with Composer and use Guzzle or any PSR-17/PSR-18 HTTP provider for flexible integration.

View on GitHub
Deep Wiki
Context7

OData Client Library for PHP

Frequently asked questions about Odata Client
How do I install and configure saintsystems/odata-client in Laravel?
Install it with composer require saintsystems/odata-client, then add guzzlehttp/guzzle if you want the recommended HTTP provider. Create a GuzzleHttpProvider, pass it to ODataClient along with your OData service URL, and bind the client as a singleton in a Laravel service provider. Put the base URL, auth mode, and timeouts in a config file so application code never hard-codes them.
Does saintsystems/odata-client support Laravel 10, 11, and 12?
The package is framework-agnostic and ships no Laravel service provider, so it does not add Laravel version constraints of its own. It is PSR-4 and Composer-installable and works inside Laravel 10, 11, and 12 when your PHP and Guzzle versions satisfy its composer.json requirements. Verify the PHP and Guzzle matrix before upgrading a major Laravel version.
How do I build OData $filter, $select, and $orderby queries in PHP?
Use the fluent builder methods where, select, orderBy, take, and skip, then call get, mirroring Laravel's Query Builder. The client translates those calls into OData query options such as $filter, $select, $orderby, $top, and $skip. This lets developers produce correct OData URLs without learning the URL grammar by hand.
Can I use Guzzle or any PSR-18 HTTP client with this OData client?
Guzzle is recommended: install guzzlehttp/guzzle and pass a GuzzleHttpProvider into ODataClient. Since 0.10.0 the client requires an explicit HTTP provider, and any PSR-17/PSR-18 implementation can be used through Psr17HttpProvider. Laravel's Http facade is not PSR-18 by default, so use Guzzle or a PSR-18 adapter.
Is there a Laravel service provider for saintsystems/odata-client?
No, the package deliberately ships without a Laravel service provider. Integration is roughly 30 lines of your own code: a config file for base URL, auth, and timeouts, a singleton binding for ODataClient, and a shared Guzzle client used by the provider. That absence is a compatibility benefit because it avoids extra.laravel constraints and third-party provider conflicts.
How do I add OAuth2 or bearer-token authentication to OData requests?
Authentication belongs on the HTTP provider, not in the OData client. With Guzzle, add an Authorization header or OAuth2 token-refresh middleware to the handler stack and pass that configured client into GuzzleHttpProvider. This keeps token lifecycle and secrets management inside your application.
How can I test OData client calls without a live OData service?
Inject a mock or fake HTTP provider into ODataClient so tests can assert generated request URLs and return fixture responses. Because the provider seam is explicit, you can capture real request URLs and responses as fixtures, then re-express them as builder calls and assert URL parity. This keeps read-path migrations testable without network calls.
Which OData versions and features like $batch, ETags, and pagination are supported?
The client is a thin query builder over OData REST endpoints and does not advertise a hard version gate, so confirm whether your service is OData v2/v3 or v4 before adopting. Common query options such as $filter, $select, $expand, $orderby, $top, and $skip are expressed fluently. Support for $batch, delta links, ETag/If-Match concurrency, automatic @odata.nextLink pagination, and structured error parsing should be validated against your endpoint because OData clients typically implement a subset.
Is saintsystems/odata-client production-ready and actively maintained?
It is MIT-licensed, Composer-installable, and maintained by Saint Systems, whose commercial product includes a Dynamics 365 add-on. Public adoption is small, semver is promised only from 1.0.0, and 0.10.0 introduced a breaking mandatory HTTP-provider change. For production, wrap it behind your own gateway interface so vendor-continuity risk becomes a swap cost rather than an application-wide rewrite.
What are alternatives to saintsystems/odata-client for Laravel OData integrations?
The main alternative is hand-rolled Guzzle or Laravel Http calls with manually concatenated OData query strings, which is exactly what this package replaces. Other OData client libraries exist, but this one's appeal is its Laravel Query Builder-style API and explicit HTTP provider abstraction. If you migrate, capture existing request URLs and responses as fixtures and prioritize read paths before write operations.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels