Download the PHP package frankkessler/salesforce-laravel-oauth2-rest without Composer

On this page you can find all versions of the php package frankkessler/salesforce-laravel-oauth2-rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package salesforce-laravel-oauth2-rest

Travis CI Build Status Coverage Status StyleCI Latest Stable Version

RUNNING UNIT TESTS

There are currently two ways to run the unit tests. Keep in mind that node is a dependency for running the unit tests regardless of which way you want to run them.

If you have make installed you can run

If you would prefer to see more details about how the unit tests run, you can start the node server and then run the unit tests from another window.

Then in a different window:

INSTALLATION

To install this package, add the following to your composer.json file

LARAVEL 5 SPECIFIC INSTALLATION TASKS

Add the following to your config/app.php file in the providers array

Add the following to your config/app.php file in the aliases array

Run the following command to pull the project config file and database migration into your project

Run the migration

OPTIONAL INSTALLATION

Logging is enabled by default if using Laravel. If not, add the following to the $config parameter when initializing the Salesforce class. (This class must implement the Psr\Log\LoggerInterface interface.)

TOKEN SETUP

Currently, this package only supports the web server flow (Authorization Code) and JWT Web Tokens for oauth2.

Web Server Flow Setup (Authorization Code)

This utilizes access and refresh tokens in order to grant access.

To get started, you'll have to setup a Connected App in Salesforce.

  1. Navigate to Setup -> Create -> Apps
  2. In the Connected Apps section, click New
  3. Fill out the form including the Api/Oauth section.
    1. Your callback URL must be https and will follow this format: http://yourdomain.com/salesforce/callback
  4. Save and wait 10 minutes for the settings to save.

Now that you have your Client Id and Client secret, add them to your .env file:

To login and authorize this application add the following to your routes.php file. You may remove these routes once you have your refresh token stored in the database.

Visit https://yourdomain.com/salesforce/login to authorize your application. Your access token and refresh token will be stored in the salesforce_tokens database table by default.

JWT Web Token

Setup your public and private key pair. Salesforce recommends you use an RSA 256 key. Here is a sample script that will generate a key for you in PHP.

Setup your app in Salesforce:

  1. Navigate to Setup -> Create -> Apps
  2. In the Connected Apps section, click New
  3. Fill out the form including the Api/Oauth section.
    1. Your callback URL must be https and will follow this format: http://yourdomain.com/salesforce/callback
    2. Check off "Use Digital Signature" and upload the PUBLIC key (public.crt) generated in the previous section.
    3. Select the Oauth scopes you want, but make sure you select the refresh_token, offline_access scope or this flow will fail.
  4. Save
  5. To get up and running as quick as possible you can follow the next few steps, but they might not work for everyone.
  6. Navigate to Setup -> Manage Apps -> Connected Apps and click on the App you just created
  7. Click edit and select "Admin approved users are pre-authorized" in the Permitted users field
  8. Click Save
  9. Scroll down on the same page and select the Manage Profiles button to add the profiles that are pre-authorized to use JWT Web Tokens in your app

Add the following variables to your .env file.

EXAMPLES

Get a sObject record

Insert a sObject record

Update a sObject record

Delete a sObject record

Perform a SOQL Query

Perform a SOQL Query that will get all the records

Perform a SOSL Query

Bulk Api Processing

Insert

Upsert

Query

Query with PK Chunking

Query with Class to Process each Batch

Custom REST Endpoint (GET)

Custom REST Endpoint (POST)


All versions of salesforce-laravel-oauth2-rest with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
guzzlehttp/guzzle Version ~6.0
frankkessler/guzzle-oauth2-middleware Version 0.1.*
illuminate/http Version ~5.1
illuminate/routing Version ~5.1
illuminate/support Version ~5.1
illuminate/database Version ~5.1
psr/log Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package frankkessler/salesforce-laravel-oauth2-rest contains the following files

Loading the files please wait ....