PHPackages                             iabuhilal/php-salesforce-kit - 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. iabuhilal/php-salesforce-kit

ActiveLibrary[API Development](/categories/api)

iabuhilal/php-salesforce-kit
============================

PHP Salesforce Rest API &amp; Bulk API v2 tool kit

110PHP

Since Jan 4Pushed 5y ago1 watchersCompare

[ Source](https://github.com/iabuhilal/php-salesforce-kit)[ Packagist](https://packagist.org/packages/iabuhilal/php-salesforce-kit)[ RSS](/packages/iabuhilal-php-salesforce-kit/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Php Salesforce Rest Api
=======================

[](#php-salesforce-rest-api)

this is based on `Bijesh Shrestha` `bjsmasth@gmail.com``iabuhilal` `php rest api`

Install
-------

[](#install)

Via Composer

```
composer require iabuhilal/php-salesforce-kit
```

Getting Started
===============

[](#getting-started)

Setting up a Connected App

1. Log into to your Salesforce org
2. Click on Setup in the upper right-hand menu
3. Under Build click `Create > Apps `
4. Scroll to the bottom and click `New` under Connected Apps.
5. Enter the following details for the remote application:
    - Connected App Name
    - API Name
    - Contact Email
    - Enable OAuth Settings under the API dropdown
    - Callback URL
    - Select access scope (If you need a refresh token, specify it here)
6. Click Save

After saving, you will now be given a Consumer Key and Consumer Secret. Update your config file with values for `consumerKey` and `consumerSecret`

Setup
=====

[](#setup)

Authentication

```
    $options = [
        'grant_type' => 'password',
        'client_id' => 'CONSUMERKEY',
        'client_secret' => 'CONSUMERSECRET',
        'username' => 'SALESFORCE_USERNAME',
        'password' => 'SALESFORCE_PASSWORD AND SECURITY_TOKEN'
    ];

    $salesforce = new iabuhilal\Salesforce\Authentication\PasswordAuthentication($options);
    $salesforce->authenticate();

    $access_token = $salesforce->getAccessToken();
    $instance_url = $salesforce->getInstanceUrl();

    Change Endpoint

    $salesforce = new iabuhilal\Salesforce\Authentication\PasswordAuthentication($options);
    $salesforce->setEndpoint('https://test.salesforce.com/');
    $salesforce->authenticate();

    $access_token = $salesforce->getAccessToken();
    $instance_url = $salesforce->getInstanceUrl();
```

Query

```
    $query = 'SELECT Id,Name FROM ACCOUNT LIMIT 100';

    $sfFunc = new \iabuhilal\Salesforce\SalesforceFunctions();
    $sfFunc->query($query);
```

Create

```

    $data = [
       'Name' => 'some name',
    ];

    $sfFunc->create('Account', $data);  #returns id
```

Update

```
    $new_data = [
       'Name' => 'another name',
    ];

    $sfFunc->update('Account', $id, $new_data); #returns status_code 204

```

Upsert

```
    $new_data = [
       'Name' => 'another name',
    ];

    $sfFunc->upsert('Account', 'API Name/ Field Name', 'value', $new_data); #returns status_code 204 or 201

```

Delete

```
    $sfFunc->delete('Account', $id);
```

#### Changelog:

[](#changelog)

##### 2020.09.09

[](#20200909)

- add closeJob function

##### 2020.09.09

[](#20200909-1)

- renamed class from CRUD to SalesforceFunctions
- add create createJob, getAllJobs functions
- add Salesforce description objects

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5962732?v=4)[Ihab](/maintainers/iabuhilal)[@iabuhilal](https://github.com/iabuhilal)

### Embed Badge

![Health badge](/badges/iabuhilal-php-salesforce-kit/health.svg)

```
[![Health](https://phpackages.com/badges/iabuhilal-php-salesforce-kit/health.svg)](https://phpackages.com/packages/iabuhilal-php-salesforce-kit)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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