PHPackages                             synergitech/laravel-salesforce - 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. synergitech/laravel-salesforce

ActiveLibrary[API Development](/categories/api)

synergitech/laravel-salesforce
==============================

This package uses omniphx/forrest to provide an Eloquent-style way of querying sObjects from Salesforce.

v0.2.2(10mo ago)037.6k↓38.5%[1 PRs](https://github.com/SynergiTech/laravel-salesforce/pulls)MITPHPPHP ^8.3CI passing

Since Mar 9Pushed 2mo ago6 watchersCompare

[ Source](https://github.com/SynergiTech/laravel-salesforce)[ Packagist](https://packagist.org/packages/synergitech/laravel-salesforce)[ RSS](/packages/synergitech-laravel-salesforce/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (8)Versions (7)Used By (0)

Laravel Salesforce
==================

[](#laravel-salesforce)

[![Tests](https://github.com/SynergiTech/laravel-salesforce/actions/workflows/test.yml/badge.svg)](https://github.com/SynergiTech/laravel-salesforce/actions/workflows/test.yml)

This package uses [omniphx/forrest](https://github.com/omniphx/forrest) to provide an Eloquent-style way of querying sObjects from Salesforce.

⚠️ This is an initial version that only allows for the selecting of data. Newer versions will aim to provide a more complete experience.

Getting Started
---------------

[](#getting-started)

Follow the instructions provided at [omniphx/forrest](https://github.com/omniphx/forrest) to connect to your Salesforce environment. Once done, you can then use the `SynergiTech\Salesforce\Facades\Salesforce` facade to perform queries against a particular table like so:

```
use SynergiTech\Salesforce\Facades\Salesforce;

// Get an individual record by Id
Salesforce::table('MyTable')->find('YourIdHere');
```

Available Methods
-----------------

[](#available-methods)

### find

[](#find)

Allows you to directly pull an individual record as an array by Id. You can also specify another field name as the second parameter. If you specify a non-unique column and multiple records are returned then the first record is always returned.

#### Usage

[](#usage)

```
Salesforce::table('MyTable')->find('YourIdHere');
```

### findMany

[](#findmany)

Allows you to directly pull multiple records as a Laravel Collection by provide an array of their respective Id fields. You can also specify another field name as the second parameter.

#### Usage

[](#usage-1)

```
Salesforce::table('MyTable')->findMany(['YourId1Here', 'YourId2Here']);
```

### create

[](#create)

Allows you to create a new record on the specified table using an array of fields.

#### Usage

[](#usage-2)

```
$response = Salesforce::table('MyTable')->create([
    'Name' => 'John Doe',
]);
```

#### Expected Response

[](#expected-response)

```
[
    'id' => '', // Salesforce Id
    'success' => true,
    'errors' => [],
    'data' => [
        // Full record data
    ],
]
```

### update

[](#update)

Allows you to update a record using it's Salesforce Id with an array of fields.

#### Usage

[](#usage-3)

```
$response = Salesforce::table('MyTable')->update('Id', [
    'Name' => 'John Doe',
]);
```

#### Expected Response

[](#expected-response-1)

See 'create' above

### createOrUpdate

[](#createorupdate)

Allows you to upsert a record using an Id field and the associated value.

#### Usage

[](#usage-4)

```
$response = Salesforce::table('MyTable')->createOrUpdate('My_External_Id__c', 'ExternalId', [
    'Name' => 'John Doe',
]);
```

#### Expected Response

[](#expected-response-2)

```
[
    'id' => '', // Salesforce Id
    'success' => true,
    'errors' => [],
    'created' => true, // True/False depending on whether the record was created or updated
    'data' => [
        // Full record data
    ],
]
```

### delete

[](#delete)

Allows you to delete a record by it's Id, returning true if successful.

#### Usage

[](#usage-5)

```
Salesforce::table('MyTable')->delete('Id');
```

Query Builder
-------------

[](#query-builder)

This package allows you to scope your get calls using query builder methods. Query builders **cannot** currently be used in conjunction with the `update` or `delete` methods (sorry 🙏).

### where

[](#where)

You can also scope your queries with where clauses.

```
// Basic where clause
Salesforce::table('MyTable')->where('Name', 'John Doe')->get();

// You can also use any of the following operators

// Equals and Not Equals
Salesforce::table('MyTable')->where('Name', '=', 'John Doe')->get();
Salesforce::table('MyTable')->where('Name', '!=', 'John Doe')->get();

// Comparisons
Salesforce::table('MyTable')->where('Age', '', 30)->get();
Salesforce::table('MyTable')->where('Age', '>=', 30)->get();

// Like
Salesforce::table('MyTable')->where('Name', 'LIKE', 'John %')->get();
Salesforce::table('MyTable')->where('Name', 'LIKE', '% Middlename %')->get();
Salesforce::table('MyTable')->where('Name', 'LIKE', '% Doe')->get();
```

### whereIn

[](#wherein)

You can provide an array of possible values to the `whereIn` method to select any records that match any of the values.

```
Salesforce::table('MyTable')->whereIn('Country', ['United Kingdom', 'United States'])->get();
```

### orderBy

[](#orderby)

You can order by a particular field in either ascending or descending order.

```
// Ascending (default)
Salesforce::table('MyTable')->orderBy('Age')->get();

// Descending
Salesforce::table('MyTable')->orderBy('Age', 'DESC')->get();
```

### nullsLast

[](#nullslast)

By default when chaining an orderBy null values are returned first. You can chain on `->nullsLast()` to return null values last.

```
Salesforce::table('MyTable')->orderBy('LastLoginDate')->nullsLast()->get();
```

### limit

[](#limit)

You can limit the amount of records returned.

```
Salesforce::table('MyTable')->where('Name', 'LIKE', 'John%')->limit(20)->get();
```

Exceptions
----------

[](#exceptions)

By default [omniphx/forrest](https://github.com/omniphx/forrest) typically throws a single exception with more detail contained within a JSON encoded string. We've wrapped some with our own exceptions to help with debugging.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance73

Regular maintenance activity

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.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 ~283 days

Total

4

Last Release

315d ago

PHP version history (2 changes)v0.1.0PHP ^8.0

v0.2.2PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![morganarnel](https://avatars.githubusercontent.com/u/84181964?v=4)](https://github.com/morganarnel "morganarnel (9 commits)")[![willpower232](https://avatars.githubusercontent.com/u/1619102?v=4)](https://github.com/willpower232 "willpower232 (3 commits)")[![williamrenfrew](https://avatars.githubusercontent.com/u/12625062?v=4)](https://github.com/williamrenfrew "williamrenfrew (1 commits)")

---

Tags

laravelsalesforcelaravelsalesforce

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/synergitech-laravel-salesforce/health.svg)

```
[![Health](https://phpackages.com/badges/synergitech-laravel-salesforce/health.svg)](https://phpackages.com/packages/synergitech-laravel-salesforce)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M5](/packages/kirschbaum-development-laravel-openapi-validator)[davispeixoto/laravel5-salesforce

Laravel 5 Salesforce Force.com PHP Toolkit port

47142.8k1](/packages/davispeixoto-laravel5-salesforce)

PHPackages © 2026

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