khachik / laravel9-salesforce
Laravel 9 Salesforce Force.com PHP Toolkit port
Requires
- php: >=8.0.0
- davispeixoto/force-dot-com-toolkit-for-php: 1.0.*
- illuminate/support: ~9.0
- vlucas/phpdotenv: ~5.5.0
Requires (Dev)
- laravel/framework: ~9.0
- phpunit/phpunit: ~4.0
This package is not auto-updated.
Last update: 2024-11-13 03:44:26 UTC
README
This Laravel 9 package provides an interface for using Salesforce CRM through its SOAP API.
(Laravel 9 Salesforce Package can be found here)
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.