PHPackages                             daikazu/eloquent-salesforce-objects - 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. [Database &amp; ORM](/categories/database)
4. /
5. daikazu/eloquent-salesforce-objects

ActiveLibrary[Database &amp; ORM](/categories/database)

daikazu/eloquent-salesforce-objects
===================================

A Laravel package that provides an Eloquent-style interface for interacting with Salesforce objects.

v1.1.0(1mo ago)846711MITPHPPHP ^8.4CI passing

Since Oct 14Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/daikazu/eloquent-salesforce-objects)[ Packagist](https://packagist.org/packages/daikazu/eloquent-salesforce-objects)[ Docs](https://github.com/daikazu/eloquent-salesforce-objects)[ GitHub Sponsors](https://github.com/Daikazu)[ RSS](/packages/daikazu-eloquent-salesforce-objects/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)Dependencies (30)Versions (10)Used By (1)

  ![Logo for Eloquent Salesforce Objects](art/header-light.png)Eloquent Salesforce Objects
===========================

[](#eloquent-salesforce-objects)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d660c0f389e82e37506b9017890a7a39c31d0e9ce752d799ced4e7550205c97e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461696b617a752f656c6f7175656e742d73616c6573666f7263652d6f626a656374732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daikazu/eloquent-salesforce-objects)[![GitHub Tests Action Status](https://camo.githubusercontent.com/acafe3956bff21a917b1dba88c4f5ba995318af932c645e882e6e1639b5572b5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6461696b617a752f656c6f7175656e742d73616c6573666f7263652d6f626a656374732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/daikazu/eloquent-salesforce-objects/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/84c1a1eff952ec513738afd70480c6c0842d621236b4c77ce0f7d7aba4c33bc9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6461696b617a752f656c6f7175656e742d73616c6573666f7263652d6f626a656374732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/daikazu/eloquent-salesforce-objects/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/03c711ed597d9ebf2f2517c8beafd7467ce837c3cea5dde6d097f8f537bbc69e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461696b617a752f656c6f7175656e742d73616c6573666f7263652d6f626a656374732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daikazu/eloquent-salesforce-objects)

A Laravel package that lets you work with Salesforce objects using Eloquent syntax. Built on top of [omniphx/forrest](https://github.com/omniphx/forrest) for authentication and API communication.

This package was heavily inspired by fabulous [roblesterjr04/EloquentSalesForce](https://github.com/roblesterjr04/EloquentSalesForce), but written from the ground up with modern PHP 8.4+, full type safety, and a cleaner architecture. If you're migrating from that package, see the [migration guide](docs/migration-from-eloquent-salesforce.md).

Features
--------

[](#features)

- **Eloquent-Style Models** - Define Salesforce objects using familiar Laravel model syntax
- **CRUD Operations** - Create, read, update, and delete Salesforce records
- **Relationships** - `hasMany`, `belongsTo`, and `hasOne`
- **Batch Queries** - Execute multiple SOQL queries in a single API call
- **Bulk Operations** - Efficient bulk insert, update, and delete
- **Aggregate Functions** - COUNT, SUM, AVG, MIN, MAX
- **Pagination** - Built-in pagination with Laravel's paginator
- **Apex REST** - Call custom Apex REST endpoints
- **Model Generator** - `php artisan make:salesforce-model` scaffolds models from live Salesforce metadata

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 12.0+
- Salesforce account with API access

Quick Start
-----------

[](#quick-start)

```
composer require daikazu/eloquent-salesforce-objects
```

Configure [omniphx/forrest](https://github.com/omniphx/forrest) with your Salesforce credentials, then scaffold a model:

```
php artisan make:salesforce-model Account
```

Or define one manually:

```
use Daikazu\EloquentSalesforceObjects\Models\SalesforceModel;

class Account extends SalesforceModel
{
    protected ?array $defaultColumns = [
        'Name',
        'Industry',
        'AnnualRevenue',
    ];
}
```

Query with familiar Eloquent syntax:

```
$accounts = Account::where('Industry', 'Technology')
    ->orderBy('Name')
    ->get();

$account = Account::create(['Name' => 'Acme Corp']);
$account->update(['Industry' => 'Manufacturing']);
$account->delete();

$account->contacts; // hasMany
$contact->account;  // belongsTo
```

See the [Quickstart Guide](docs/quickstart.md) for a full walkthrough.

Documentation
-------------

[](#documentation)

### Getting Started

[](#getting-started)

- [Installation](docs/installation.md)
- [Configuration](docs/configuration.md)
- [Quickstart Guide](docs/quickstart.md)

### Core Concepts

[](#core-concepts)

- [Model Generator](docs/model-generator.md) - Scaffold models from live metadata
- [Models](docs/models.md) - Defining and configuring models
- [Querying Data](docs/querying.md) - Building SOQL queries
- [CRUD Operations](docs/crud.md) - Create, read, update, delete
- [Relationships](docs/relationships.md) - hasMany, belongsTo, hasOne
- [Timestamps](docs/timestamps.md) - Carbon date handling

### Advanced

[](#advanced)

- [Batch Queries](docs/batch-queries.md) - Multiple queries in one API call
- [Bulk Operations](docs/bulk-operations.md) - Bulk insert, update, delete
- [Apex REST](docs/apex-rest.md) - Custom Apex REST endpoints
- [Aggregate Functions](docs/aggregates.md) - COUNT, SUM, AVG, MIN, MAX
- [Pagination](docs/pagination.md) - Paginating results

### Reference

[](#reference)

- [Configuration Reference](docs/configuration.md)
- [Troubleshooting](docs/troubleshooting.md)
- [Migrating from EloquentSalesForce](docs/migration-from-eloquent-salesforce.md)

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Mike Wall](https://github.com/daikazu)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. See [LICENSE](LICENSE.md).

---

**Need help?** Check the [docs](docs/) or [open an issue](https://github.com/daikazu/eloquent-salesforce-objects/issues).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance93

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

Every ~36 days

Recently: every ~13 days

Total

7

Last Release

34d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4039367?v=4)[Mike Wall](/maintainers/daikazu)[@daikazu](https://github.com/daikazu)

---

Top Contributors

[![daikazu](https://avatars.githubusercontent.com/u/4039367?v=4)](https://github.com/daikazu "daikazu (68 commits)")

---

Tags

eloquent-ormlaravel-packagesalesforce-apilaraveleloquentsalesforceforrestdaikazu

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/daikazu-eloquent-salesforce-objects/health.svg)

```
[![Health](https://phpackages.com/badges/daikazu-eloquent-salesforce-objects/health.svg)](https://phpackages.com/packages/daikazu-eloquent-salesforce-objects)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.1M11.1k](/packages/illuminate-database)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[watson/validating

Eloquent model validating trait.

9733.4M53](/packages/watson-validating)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

438834.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

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