Download the PHP package flinty916/laravel-salesforce without Composer
On this page you can find all versions of the php package flinty916/laravel-salesforce. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-salesforce
Laravel Salesforce
This package provides a streamlined way to integrate Salesforce objects into your Laravel application.
It includes a custom query builder, model base class, and an Artisan command to automatically generate strongly-typed PHP classes for your Salesforce SObjects.
Installation
Install via Composer:
Environment Variables
Before using the package, you must configure your Salesforce credentials in your Laravel .env file:
| Variable | Description |
|---|---|
SALESFORCE_CLIENT_ID |
The Consumer Key from your Salesforce Connected App. |
SALESFORCE_CLIENT_SECRET |
The Consumer Secret from your Salesforce Connected App. |
SALESFORCE_USERNAME |
Salesforce username used for authentication. |
SALESFORCE_PASSWORD |
Salesforce password plus security token (if required). |
SALESFORCE_LOGIN_URL |
Salesforce login URL — usually https://login.salesforce.com (production) or https://test.salesforce.com (sandbox). |
SALESFORCE_GRANT_TYPE |
Salesforce grant_type - currently supports password flow (legacy) and client_credentials |
SALESFORCE_API_VERSION |
Salesforce API version to use. Defaults to 58.0 |
Example .env
Generating Salesforce Objects
This package ships with an Artisan command to generate PHP classes for your Salesforce SObjects.
All Objects
This will connect to your Salesforce instance, retrieve all available objects, and create corresponding PHP classes in the app/SalesforceObjects directory. Please be warned, if you have a large salesforce instance, with lots of objects, this will be a long running command. I recommend you generate specific objects only (as shown below).
Specific Objects
You can limit generation to one or more objects using the --objects option:
This will only generate classes for the specified Salesforce Objects.
Example Usage
Once an object has been generated, you can make use of Eloquent style operations.
Create an Object
List Objects
Find an Object
Update an Object
Delete an Object
Describe an Object
Occasionally you'll need to obtain the metadata of an object, including Picklist values, fields, and more. This
is the use case for the describe method, which returns the API response from a salesforce sobject/<object>/describe
request.
Working with Chatter Feeds
This package includes first-class support for Salesforce Chatter feeds, allowing you to retrieve, post, update, and comment on feed items related to any Salesforce record (e.g., an Opportunity, Account, or Case).
Retrieving Feed Items
You can access a record’s chatter feed through the chatter() helper:
Under the hood, this calls the Salesforce Chatter REST API:
and automatically maps the response into PHP objects for easy access.
Posting a New Message
To create a new post on a record’s feed, call post():
This issues a POST request to:
and creates a FeedItem linked to the record.
Updating a Message
If you need to edit a feed message (your own post), you can use update():
This sends a PATCH request to:
and updates the feed item’s body content.
Commenting on a Message
To add a comment to an existing feed item, use comment():
This issues a POST request to:
and appends a new FeedComment to the specified post.
Example Workflow
Notes
Feed actions are available for any Salesforce record with an associated Chatter feed (FeedEnabled objects). Returned data is normalized through SalesforceChatterResponse, so you can iterate and inspect feed elements easily. Posting and commenting automatically handle message segment formatting — plain text is supported by default, but future versions will support rich mentions, links, and file attachments.