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.0.0-beta.1(5mo ago)5441[1 issues](https://github.com/daikazu/eloquent-salesforce-objects/issues)[1 PRs](https://github.com/daikazu/eloquent-salesforce-objects/pulls)MITPHPPHP ^8.4CI passing

Since Oct 14Pushed 3w 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 today

READMEChangelog (2)Dependencies (15)Versions (4)Used By (0)

  ![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)

> **⚠️ WORK IN PROGRESS**
>
> This package is currently under active development and should be considered **alpha/beta quality**. While it is functional and tested, the API may change, and there may be undiscovered bugs.
>
> **Use at your own risk in production environments.** We recommend thorough testing in development/staging environments before deploying to production. Please report any issues you encounter!

Eloquent Salesforce Objects is a powerful Laravel package built on top of the excellent [omniphx/forrest](https://github.com/omniphx/forrest) package. It provides an Eloquent-style interface for working with Salesforce objects, allowing you to define Salesforce models just like Eloquent models and interact with your Salesforce data using familiar Laravel conventions.

Features
--------

[](#features)

- **Eloquent-Style Models** - Define Salesforce objects using familiar Laravel model syntax
- **CRUD Operations** - Create, read, update, and delete Salesforce records
- **Relationships** - Support for `hasMany`, `belongsTo`, and `hasOne` relationships
- **Aggregate Functions** - COUNT, SUM, AVG, MIN, MAX support
- **Pagination** - Built-in pagination with Laravel's paginator
- **Bulk Operations** - Efficient bulk insert, update, and delete operations
- **Automatic Authentication** - Seamless OAuth token management via [omniphx/forrest](https://github.com/omniphx/forrest)
- **Field Mapping** - Automatic conversion between Laravel and Salesforce naming conventions (optional)

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

[](#requirements)

- **PHP** 8.4 or higher
- **Laravel** 12.0 or higher
- **Salesforce** Account with API access enabled
- **[omniphx/forrest](https://github.com/omniphx/forrest)** - Salesforce REST API client (installed automatically as a dependency)

Table of Contents
-----------------

[](#table-of-contents)

- [Quick Start](#quick-start)
- [Installation &amp; Configuration](#installation--configuration)
- [Documentation](#documentation)
    - [Quickstart Guide](docs/quickstart.md)
    - [Models](docs/models.md)
    - [Querying Data](docs/querying.md)
    - [CRUD Operations](docs/crud.md)
    - [Relationships](docs/relationships.md)
    - [Working with Timestamps](docs/timestamps.md)
    - [Bulk Operations](docs/bulk-operations.md)
    - [Custom Apex REST Endpoints](docs/apex-rest.md)
    - [Aggregate Functions](docs/aggregates.md)
    - [Pagination](docs/pagination.md)
    - [Troubleshooting](docs/troubleshooting.md)
- [Testing](#testing)
- [Credits](#credits)
- [License](#license)

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

[](#quick-start)

### Installation

[](#installation)

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

### Configuration

[](#configuration)

Before using this package, you must configure the [omniphx/forrest](https://github.com/omniphx/forrest) package, which handles Salesforce authentication and API communication.

1. **Publish the Forrest configuration:**

    ```
    php artisan vendor:publish --provider="Omniphx\Forrest\Providers\Laravel\ForrestServiceProvider"
    ```
2. **Configure your Salesforce credentials** in `config/forrest.php` and `.env`
3. **See the [Forrest documentation](https://github.com/omniphx/forrest) for detailed setup instructions**
4. **Optionally publish this package's configuration:**

    ```
    php artisan vendor:publish --tag="eloquent-salesforce-objects-config"
    ```

For complete setup instructions, see our [Installation Guide](docs/installation.md).

### Basic Usage

[](#basic-usage)

Define a Salesforce model and query data using familiar Eloquent syntax:

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

class Account extends SalesforceModel
{
    protected $table = 'Account';
    protected $fillable = ['Name', 'Industry', 'AnnualRevenue'];
}

// Query with familiar Eloquent syntax
$accounts = Account::where('Industry', 'Technology')
    ->orderBy('Name')
    ->get();

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

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

Check out the [Quickstart Guide](docs/quickstart.md) for detailed examples and step-by-step instructions.

Installation &amp; Configuration
--------------------------------

[](#installation--configuration)

For detailed installation and configuration instructions, see:

- **[Installation Guide](docs/installation.md)** - Complete setup walkthrough
- **[Configuration Reference](docs/configuration.md)** - All configuration options
- **[omniphx/forrest Documentation](https://github.com/omniphx/forrest)** - Salesforce API client setup

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

[](#documentation)

### Getting Started

[](#getting-started)

- **[Installation Guide](docs/installation.md)** - Detailed installation and setup instructions
- **[Configuration](docs/configuration.md)** - Configure Salesforce connection and package options
- **[Quickstart Guide](docs/quickstart.md)** - Get up and running in 5 minutes

### Core Concepts

[](#core-concepts)

- **[Models](docs/models.md)** - Creating and configuring Salesforce models
- **[Querying Data](docs/querying.md)** - Building SOQL queries with the query builder
- **[CRUD Operations](docs/crud.md)** - Creating, reading, updating, and deleting records
- **[Relationships](docs/relationships.md)** - Defining and using relationships between objects
- **[Working with Timestamps](docs/timestamps.md)** - Using Carbon for date manipulation with `diffForHumans()` and more

### Advanced Features

[](#advanced-features)

- **[Bulk Operations](docs/bulk-operations.md)** - Efficient bulk insert, update, and delete
- **[Custom Apex REST Endpoints](docs/apex-rest.md)** - Call custom Apex REST endpoints
- **[Aggregate Functions](docs/aggregates.md)** - Using COUNT, SUM, AVG, MIN, MAX
- **[Pagination](docs/pagination.md)** - Paginating large result sets

### Reference

[](#reference)

- **[Configuration Reference](docs/configuration.md)** - All configuration options explained
- **[Troubleshooting](docs/troubleshooting.md)** - Common issues and solutions

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

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

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

---

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

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance81

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

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 ~0 days

Total

2

Last Release

157d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00a5aa701f964455918b2e454e7b460fe2ef729639337a059d5bac12e162027e?d=identicon)[daikazu](/maintainers/daikazu)

---

Top Contributors

[![daikazu](https://avatars.githubusercontent.com/u/4039367?v=4)](https://github.com/daikazu "daikazu (16 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

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4832.7M8](/packages/dyrynda-laravel-model-uuid)[rob-lester-jr04/eloquent-sales-force

An eloquent model data source for Salesforce

94469.4k1](/packages/rob-lester-jr04-eloquent-sales-force)[indexzer0/eloquent-filtering

Powerful eloquent filtering

22523.2k2](/packages/indexzer0-eloquent-filtering)[kiwilan/typescriptable-laravel

PHP package for Laravel to type Eloquent models, routes, Spatie Settings with autogenerated TypeScript. If you want to use some helpers with Inertia, you can install associated NPM package.

4019.6k](/packages/kiwilan-typescriptable-laravel)[okeonline/filament-archivable

A filament plugin to use archivable models

207.9k](/packages/okeonline-filament-archivable)

PHPackages © 2026

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