Skip to content
Laravel 5 wrapper for Salesforce Force.com Toolkit SOAP API
PHP
Branch: master
Clone or download
Latest commit e2b34e7 Dec 19, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Davispeixoto/Laravel5Salesforce fix login Dec 19, 2016
tests init from back package Apr 27, 2015
.gitignore clearing Codacy, Scrutinizer and Insights May 4, 2015
.travis.yml
LICENSE.md going on Apr 28, 2015
README.md Corrects the syntax of the example usage. Sep 28, 2016
composer.json Fixed dot env dependency Apr 7, 2016
phpunit.xml

README.md

Laravel 5 Salesforce

This Laravel 5 package provides an interface for using Salesforce CRM through its SOAP API.

(Laravel 4 Salesforce Package can be found here)

Latest Stable Version Total Downloads Scrutinizer Code Quality Codacy Badge Code Climate Build Status SensioLabsInsight

Major upgrade

This package is intended to support both Laravel 5.1 LTS and 5.2+.

Laravel 5.1 package will be kept under version 1.* Laravel 5.2 package will be kept under version 2.*

Consider this when installing or upgrading

It also fixes a too much consuming session at Salesforce, thus these new versions needs adding the section aliases under config/app.php

Installation

The Laravel 5 package can be installed via Composer by requiring the davispeixoto/laravel5-salesforce package in your project's composer.json.

{
    "require": {
        "davispeixoto/laravel5-salesforce": "~1.0"
    }
}

And running a composer update from your terminal:

php composer.phar update

To use the Salesforce Package, you must register the provider when bootstrapping your Laravel 5 application.

Find the providers key in your config/app.php and register the AWS Service Provider.

    'providers' => array(
        // ...
        Davispeixoto\Laravel5Salesforce\SalesforceServiceProvider::class,
    )
    
    'aliases' => array(
        // ...
        'Salesforce' => Davispeixoto\Laravel5Salesforce\SalesforceFacade::class,
    )

Configuration

By default, the package uses the following environment variables to auto-configure the plugin without modification:

SALESFORCE_USERNAME
SALESFORCE_PASSWORD
SALESFORCE_TOKEN

Place your your enterprise WSDL file into your app storage/app/wsdl/ directory.

To customize the configuration file, publish the package configuration using Artisan.

php artisan vendor:publish

Update the settings in the generated config/salesforce.php configuration file with your credentials.

return [
    'username' => 'YOUR_SALESFORCE_USERNAME',
    'password' => 'YOUR_SALESFORCE_PASSWORD',
    'token' => 'YOUR_SALESFORCE_TOKEN',
    'wsdl' => 'path/to/your/enterprise.wsdl.xml',
];

IMPORTANT: the PHP Force.com Toolkit for PHP only works with Enterprise WSDL

Usage

That's it! You're all set to go. Just use:

    Use Salesforce;
    Route::get('/test', function() {
        try {
            echo print_r(Salesforce::describeLayout('Account'), true);
        } catch (Exception $e) {
            echo $e->getMessage();
            echo $e->getTraceAsString();
        }
    });

More Information

Check out the SOAP API Salesforce Documentation

License

This software is licensed under the MIT license

Versioning

This project follows the Semantic Versioning

Thanks

An amazing "Thank you, guys!" for Jetbrains folks, who kindly empower this project with a free open-source license for PhpStorm which can bring a whole new level of joy for coding.

Jetbrains

PhpStorm

You can’t perform that action at this time.