PHP code example of synergitech / laravel-salesforce
1. Go to this page and download the library: Download synergitech/laravel-salesforce library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
synergitech / laravel-salesforce example snippets
use SynergiTech\Salesforce\Facades\Salesforce;
// Get an individual record by Id
Salesforce::table('MyTable')->find('YourIdHere');
[
'id' => '', // Salesforce Id
'success' => true,
'errors' => [],
'created' => true, // True/False depending on whether the record was created or updated
'data' => [
// Full record data
],
]
Salesforce::table('MyTable')->delete('Id');
// 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();
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();