Giter Site home page Giter Site logo

laravel-salesforce's Introduction

Laravel Salesforce

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

Major upgrade

This package is intended to support both Laravel 6.x and 7.x

For Laravel 5.x support, see Davispeixoto's original package

Installation

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

{
    "require": {
        "toonboom/laravel-salesforce": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "[email protected]:toonboom/laravel-salesforce.git"
        }
    ]
}

And running a composer update from your terminal:

php composer update

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

Find the providers key in your config/app.php and register the Service Provider (namespace is unchanged from original)

    '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();
        }
    });
Use Salesforce;
$query = "SELECT ..., ..., ... FROM Object__c WHERE Id = '$this->id'";
$bank = Salesforce::query($query)->records;

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

laravel-salesforce's People

Contributors

alexlombry avatar davispeixoto avatar dependabot[bot] avatar hemorej avatar josecanhelp avatar karlpatrickespiritu avatar robdudley avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.