PHP code example of setechsolutions / eloquent-sales-force

1. Go to this page and download the library: Download setechsolutions/eloquent-sales-force 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/ */

    

setechsolutions / eloquent-sales-force example snippets


$leads = Lead::where('Company', 'Acme')->orderBy('LastName')->limit(20)->get();

$lead = Lead::create(['LastName' => 'Lovelace', 'Company' => 'Analytical Engines']);

$lead->update(['Status' => 'Working - Contacted']);

$account->contacts()->where('Email', 'like', '%@example.com')->get();

namespace App\Models;

use SETechSolutions\EloquentSalesForce\Model;

class Lead extends Model
{
    public $columns = ['Id', 'FirstName', 'LastName', 'Email', 'Company'];
}

use SETechSolutions\EloquentSalesForce\Facades\SObjects;

$salesforce = SObjects::fake([
    'Lead' => [['Id' => '00Q000000000001AAA', 'Company' => 'Acme']],
]);

$this->post('/leads/00Q000000000001AAA/qualify');

$salesforce->assertUpdated('Lead', '00Q000000000001AAA', ['Status' => 'Qualified']);
bash
php artisan make:salesforce Lead