justbetter/odata-client
| Install | |
|---|---|
composer require justbetter/odata-client |
|
| Latest Version: | 1.5.0 |
| PHP: | ^8.3 |
| License: | MIT |
| Last Updated: | Mar 19, 2026 |
| Links: | GitHub · Packagist |
Get started with the OData Client for PHP
A fluent library for calling OData REST services inspired by and based on the Laravel Query Builder.
This library is a fork of saintsystems/odata-client. The maintainer seems to have abandoned the repo. We will maintain this fork and accept new PR's
Looking for a way to interact with Microsoft Dynamics? Checkout our Laravel Dynamics Client!
Install the SDK
You can install the PHP SDK with Composer.
composer require justbetter/odata-client
Call an OData Service
The following is an example that shows how to call an OData service.
<?php
require_once __DIR__ . '/vendor/autoload.php';
use SaintSystems\OData\ODataClient;
class UsageExample
{
public function __construct()
{
$odataServiceUrl = 'https://services.odata.org/V4/TripPinService';
$odataClient = new ODataClient($odataServiceUrl);
// Retrieve all entities from the "People" Entity Set
$people = $odataClient->from('People')->get();
// Or retrieve a specific entity by the Entity ID/Key
try {
$person = $odataClient->from('People')->find('russellwhyte');
echo "Hello, I am $person->FirstName ";
} catch (Exception $e) {
echo $e->getMessage();
}
// Want to only select a few properties/columns?
$people = $odataClient->from('People')->select('FirstName','LastName')->get();
}
}
$example = new UsageExample();
Develop
Run Tests
Run vendor/bin/phpunit from the base directory.
Documentation and resources
Issues
View or log issues on the Issues tab in the repo.
Copyright and license
Copyright (c) Saint Systems, LLC. All Rights Reserved. Licensed under the MIT license.
Related Packages
Helps building nice, normalized and easy to consume Laravel REST API.
A Laravel client for querying and transforming results from eXist-db via REST AP...