PHPackages                             alexacrm/php-crm-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. alexacrm/php-crm-toolkit

ActiveLibrary[API Development](/categories/api)

alexacrm/php-crm-toolkit
========================

PHP Toolkit for Microsoft Dynamics CRM

20241114(1y ago)109293.3k↓12.9%39[10 issues](https://github.com/AlexaCRM/php-crm-toolkit/issues)[1 PRs](https://github.com/AlexaCRM/php-crm-toolkit/pulls)1LGPL-3.0PHP

Since Aug 15Pushed 1y ago10 watchersCompare

[ Source](https://github.com/AlexaCRM/php-crm-toolkit)[ Packagist](https://packagist.org/packages/alexacrm/php-crm-toolkit)[ RSS](/packages/alexacrm-php-crm-toolkit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (32)Used By (1)

php-crm-toolkit
===============

[](#php-crm-toolkit)

CRM Toolkit for PHP provides integration with Microsoft Dynamics CRM in PHP applications.

This toolkit supports **only** Dynamics 365 SOAP interface. For PHP implementation of the Dynamics 365 Web API, see [dynamics-webapi-toolkit project](https://github.com/AlexaCRM/dynamics-webapi-toolkit).

Installation
------------

[](#installation)

Install the latest version with

```
$ composer require alexacrm/php-crm-toolkit:dev-master
```

Examples
========

[](#examples)

```
/**
 * Use init.php if you didn't install the package via Composer
 */
require_once 'vendor/autoload.php';

use AlexaCRM\CRMToolkit\Client as OrganizationService;
use AlexaCRM\CRMToolkit\Settings;

$contactId = '1d2fc62f-1c56-448b-b546-edfb6d6fec5c';
/*
* WS-Trust is now deprecated

$options = [
    'serverUrl' => 'https://org.crmN.dynamics.com',
    'username' => 'portal@org.onmicrosoft.com',
    'password' => 'portalPassword',
    'authMode' => 'OnlineFederation',
];

$serviceSettings = new Settings( $options );

*/

$options = [
	'serverUrl' => 'https://org.crmN.dynamics.com',
	'applicationId' => '1111c62f-dead-beef-dead-edfbffffec5c',
	'clientSecret' => 'whateveristhesecretgenerated',
	'authMode' => 'OnlineFederation',
	'authMethod' => 'sharedSecretAuth',
	'cache' => new AlexaCRM\CRMToolkit\NullCache(),
];

// This code uses NullCache which allows to connect and run the operations
// but it is very inefficient and should not be used in production.
// You can use any PSR-6 compliant cache implementation.
$serviceSettings = new OnlineS2SSecretAuthenticationSettings( $options );
$service = new OrganizationService( $serviceSettings );

// retrieve a contact and update its fields
$contact = $service->entity( 'contact', $guid );
$contact->firstname = explode( '@', $contact->emailaddress1 )[0];
$contact->update();
printf( 'Info for %s %s updated.', $contact->firstname, $contact->lastname );

// create a new contact
$contact = $service->entity( 'contact' );
$contact->firstname = 'John';
$contact->lastname = 'Doe';
$contact->emailaddress1 = 'john.doe@example.com';
$contactId = $contact->create();

// delete a contact
$contact->delete();

// execute an action
$whoAmIResponse = $service->executeAction( 'WhoAmI' );
echo 'Organization ID: ' . $whoAmIResponse->OrganizationId;

// inject cache repo
// must be instance of AlexaCRM\CRMToolkit\CacheInterface
$cacheRepo = Cache::instance();
$service = new Client( $serviceSettings, $cacheRepo );
```

In `/examples/` you can find a few examples of toolkit usage. Copy `config.example.php` to `config.php`, set up credentials for your CRM and you are ready to go!

Contributing
============

[](#contributing)

Pull requests are gladly accepted in the [GitHub repository](https://github.com/AlexaCRM/php-crm-toolkit).

License
=======

[](#license)

Copyright (c) 2016 AlexaCRM.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Lesser Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see .

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 86.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~100 days

Recently: every ~227 days

Total

31

Last Release

550d ago

Major Versions

v1.2 → 9404.x-dev2022-05-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/76e79324c14d56ed2bb8e729129d16566551cc969b34f98bd760549ce2426292?d=identicon)[wizardist](/maintainers/wizardist)

![](https://www.gravatar.com/avatar/d08eaf8e4daafd968d7fb9977bbbfe50b0a27ea8cff99cb5a85feca12ed65b4f?d=identicon)[alexacrm](/maintainers/alexacrm)

---

Top Contributors

[![wizardist](https://avatars.githubusercontent.com/u/532481?v=4)](https://github.com/wizardist "wizardist (131 commits)")[![georged](https://avatars.githubusercontent.com/u/928254?v=4)](https://github.com/georged "georged (10 commits)")[![mrudov](https://avatars.githubusercontent.com/u/44767596?v=4)](https://github.com/mrudov "mrudov (8 commits)")[![billstennett](https://avatars.githubusercontent.com/u/36301769?v=4)](https://github.com/billstennett "billstennett (1 commits)")[![cburschka-pwc](https://avatars.githubusercontent.com/u/24293488?v=4)](https://github.com/cburschka-pwc "cburschka-pwc (1 commits)")[![KevinBaland](https://avatars.githubusercontent.com/u/30312527?v=4)](https://github.com/KevinBaland "KevinBaland (1 commits)")

---

Tags

dynamics-365dynamics-crmsoapphpsdkcrmDynamics CRM

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexacrm-php-crm-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/alexacrm-php-crm-toolkit/health.svg)](https://phpackages.com/packages/alexacrm-php-crm-toolkit)
```

###  Alternatives

[paddlehq/paddle-php-sdk

Paddle's PHP SDK for Paddle Billing.

53301.7k](/packages/paddlehq-paddle-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
