khachik/laravel9-salesforce 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

khachik/laravel9-salesforce

Composer 安装命令:

composer require khachik/laravel9-salesforce

包简介

Laravel 9 Salesforce Force.com PHP Toolkit port

README 文档

README

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

(Laravel 9 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 9.0 LTS and 9.0+.

Laravel 9.1 package will be kept under version 1.* Laravel 9.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 9 package can be installed via Composer by requiring the khachik/laravel9-salesforce package in your project's composer.json.

{
    "require": {
        "khachik/laravel9-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 9 application.

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

    'providers' => array(
        // ...
        Khachik\Laravel9Salesforce\SalesforceServiceProvider::class,
    )
    
    'aliases' => array(
        // ...
        'Salesforce' => Khachik\Laravel9Salesforce\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

统计信息

  • 总下载量: 524
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-17