khachik / laravel10-salesforce
Laravel 10 Salesforce Force.com PHP Toolkit port
Requires
- php: >=8.1.0
- davispeixoto/force-dot-com-toolkit-for-php: 1.0.*
- illuminate/support: ~10.10
- vlucas/phpdotenv: ~5.5.0
Requires (Dev)
- laravel/framework: ~10.0
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-11-12 20:27:23 UTC
README
This Laravel 10 package provides an interface for using Salesforce CRM through its SOAP API.
(Laravel 7 Salesforce Package can be found here)
Major upgrade
This package is intended to support both Laravel 10.0 LTS and 10.0+.
Laravel 10.1 package will be kept under version 1.* Laravel 10.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
khachik/laravel10-salesforce
package in your project's composer.json
.
{ "require": { "khachik/laravel10-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( // ... Khachik\Laravel10Salesforce\SalesforceServiceProvider::class, ) 'aliases' => array( // ... 'Salesforce' => Khachik\Laravel0Salesforce\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.