PHP code example of daikazu / eloquent-salesforce-objects
1. Go to this page and download the library: Download daikazu/eloquent-salesforce-objects 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/ */
daikazu / eloquent-salesforce-objects example snippets
use Daikazu\EloquentSalesforceObjects\Models\SalesforceModel;
class Account extends SalesforceModel
{
protected ?array $defaultColumns = [
'Name',
'Industry',
'AnnualRevenue',
];
}
$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
bash
php artisan make:salesforce-model Account