Skip to content


Switch branches/tags

Latest commit

* Allow PHP 8.0

* Laravel 9 compatibility

* Revert "Laravel 9 compatibility"

This reverts commit 74b6012.

* Where raw

* Feedback

Git stats


Failed to load latest commit information.

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 currently in preview. Please continue to provide feedback as we iterate towards a production-supported library.

Build Status Latest Version on Packagist Total Downloads

For WordPress users, please see our Gravity Forms Dynamics 365 Add-On.

Install the SDK

You can install the PHP SDK with Composer.

composer require saintsystems/odata-client

Call an OData Service

The following is an example that shows how to call an OData service.


require_once __DIR__ . '/vendor/autoload.php';

use SaintSystems\OData\ODataClient;

class UsageExample
	public function __construct()
		$odataServiceUrl = '';

		$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();


Run Tests

Run vendor/bin/phpunit from the base directory.

Documentation and resources


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.