PHPackages                             myoutdeskllc/salesforce-php-query-builder - 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. myoutdeskllc/salesforce-php-query-builder

ActiveLibrary

myoutdeskllc/salesforce-php-query-builder
=========================================

library to help build soql queries for use with the rest api

1.0.0(10mo ago)01.7k↓49.8%MITPHPCI passing

Since May 1Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/MyOutDeskLLC/salesforcephp-query-builder)[ Packagist](https://packagist.org/packages/myoutdeskllc/salesforce-php-query-builder)[ RSS](/packages/myoutdeskllc-salesforce-php-query-builder/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Salesforce PHP Query Builder
============================

[](#salesforce-php-query-builder)

Helps assemble SOQL queries for use with Salesforce REST API.

Features
--------

[](#features)

- Fluent, chainable API
- Supports `WHERE`, `ORDER BY`, `LIMIT`, `OFFSET`
- Grouped and nested conditional expressions
- Support for `WHERE IN`, `WHERE NOT IN`, `OR WHERE IN`, `OR WHERE NOT IN`
- `WHERE NULL` and `WHERE DATE` clauses
- Function-based WHERE clauses
-

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

[](#installation)

```
composer require myoutdeskllc/salesforce-php-query-builder

```

Usage
-----

[](#usage)

```
use Myoutdeskllc\SalesforcePhpQueryBuilder\QueryBuilder;

$qb = (new QueryBuilder())
    ->from('Account')
    ->select(['Id', 'Name', 'Description'])
    ->where('Name', '=', 'Mikhail')
    ->orderBy('Name')
    ->limit(10)
    ->offset(15);

$soql = $qb->toSoql();

echo $soql;
// SELECT Id, Name, Description FROM Account WHERE Name = 'Mikhail' ORDER BY Name ASC LIMIT 10 OFFSET 15
```

Supported Clauses
-----------------

[](#supported-clauses)

### Where

[](#where)

```
$qb->where('Amount', '=', 100);
$qb->whereNull('ClosedDate');
$qb->whereDate('CreatedDate', '=', '2024-01-01');
$qb->whereIn('Status', ['Active', 'Pending']);
$qb->whereNotIn('Stage', ['Closed Won', 'Closed Lost']);
$qb->orWhere('IsActive', '=', true);
```

### Grouped Conditions

[](#grouped-conditions)

```
$qb->startWhere()
   ->where('A', '=', 1)
   ->orWhere('B', '=', 2)
   ->endWhere();
```

### Order, Limit, Offset

[](#order-limit-offset)

```
$qb->orderBy('Name');
$qb->orderByDesc('CreatedDate');
$qb->limit(5);
$qb->offset(10);
```

Tests
-----

[](#tests)

```
composer install
vendor/bin/pest

```

###  Health Score

31

—

LowBetter than 71% of packages

Maintenance53

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

324d ago

### Community

Maintainers

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

---

Top Contributors

[![WalrusSoup](https://avatars.githubusercontent.com/u/5719851?v=4)](https://github.com/WalrusSoup "WalrusSoup (3 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/myoutdeskllc-salesforce-php-query-builder/health.svg)

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

PHPackages © 2026

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