PHPackages                             binfotech/laravel-infusionsoft - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. binfotech/laravel-infusionsoft

ActiveLibrary[API Development](/categories/api)

binfotech/laravel-infusionsoft
==============================

This package provides port of the Infusionsoft SDK utilizing Laravel fascades.

1762PHP

Since Jun 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/binfotech/laravel-infusionsoft)[ Packagist](https://packagist.org/packages/binfotech/laravel-infusionsoft)[ RSS](/packages/binfotech-laravel-infusionsoft/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/fce3e423b8e0d5c36f43877a0a884cdd407cfb1daab27932629e639784263dd7/68747470733a2f2f706f7365722e707567782e6f72672f62696e666f746563682f6c61726176656c2d696e667573696f6e736f66742f646f776e6c6f6164732e7376673f666f726d61743d666c6174)](https://packagist.org/packages/binfotech/laravel-infusionsoft)[![Latest Stable Version](https://camo.githubusercontent.com/6417b337004d68548eff13dcbd05a93c189bb9254c3c78fd08540a3559bb8a83/68747470733a2f2f706f7365722e707567782e6f72672f62696e666f746563682f6c61726176656c2d696e667573696f6e736f66742f762f737461626c652e7376673f666f726d61743d666c6174)](https://packagist.org/packages/binfotech/laravel-infusionsoft)

Laravel 6, 7 &amp; 8 Laravel Infusionsoft
=========================================

[](#laravel-6-7--8-laravel-infusionsoft)

[Buy me a coffee](https://www.buymeacoffee.com/binfotech) ☕

This package eases the oAuth flow for authentication and helps with token management.

New in ^4.1
-----------

[](#new-in-41)

Added ability to connect to multiple Infusionsoft accounts!

Installation
------------

[](#installation)

Use composer to install this package:

```
composer require binfotech/laravel-infusionsoft

```

For Laravel 5.6+, this package uses service provider and alias auto discovery. You can still add the service provider and alias below in `config/app.php`.

```
Binfotech\Infusionsoft\InfusionsoftServiceProvider::class,

```

in the `providers` array and optionally

```
'Infusionsoft' => Binfotech\Infusionsoft\InfusionsoftFacade::class,

```

to the `aliases` array.

Configuration
-------------

[](#configuration)

Publish `infusionsoft.php` config file.

```
php artisan vendor:publish --provider="Binfotech\Infusionsoft\InfusionsoftServiceProvider" --tag="config"
```

Environment
-----------

[](#environment)

Fill in your Client ID and Secret along with the redirect URI and cache store. Default values are used below.

```
INFUSIONSOFT_CLIENT_ID=
INFUSIONSOFT_CLIENT_SECRET=
INFUSIONSOFT_CACHE=file
INFUSIONSOFT_REDIRECT_URI="/infusionsoft/auth/callback"

```

To allow for multiple connected accounts, your .env will need these additional arguments. The first signifies there will be multiple connected Infusionsoft accounts, the second is a JSON encoded and escaped string with your API credentials. The array has identifying keys that will be explained later when making API calls.

```
INFUSIONSOFT_MULTI=true
INFUSIONSOFT_ACCOUNTS='[{\"account1\": {\"client_id\": \"\",\"client_secret\": \"\",\"redirect_uri\": \"\/infusionsoft\/account1\/auth\/callback\"}},{\"account2\": {\"client_id\": \"\",\"client_secret\": \"\",\"redirect_uri\": \"\/infusionsoft\/account2\/auth\/callback\"}}]'

```

Credentials
-----------

[](#credentials)

Once you have all the necessary authorization information entered in your `.env` we can begin the authorization process.

You may access the route `/infusionsoft/auth` to begin the authorization process. This route will generate the necessary authorization URL to infusionsoft and redirect you to your Infusionsoft application. You must log into Infusionsoft and authorize your app to use the Infusionsoft API. Once you `allow`, you will be redirected back to your application `/infusionsoft/auth/callback`. Here you will either receive an exception or a successful message.

When using multiple connected accounts, your authorization URLs will change with your identifying keys. For example, `/infusionsoft/account1/auth` and `/infusionsoft/account1/auth/callback` for each respective account you want to connect.

Redirect URI
------------

[](#redirect-uri)

INFUSIONSOFT\_REDIRECT\_URI if used, will override the callback from Infusionsoft and will result in the `infusionsoft.token` to not get created. This means you will need to handle the authorization code returned back from Infusionsoft to request an access token.

For multiple account connections, the redirect URI needs to follow this pattern:

```
/infusionsoft/{account1}/auth
/infusionsoft/{account1}/auth/callback

```

Token Name &amp; Cache
----------------------

[](#token-name--cache)

Token name default is `infusionsoft.token`, but can be overridden by INFUSIONSOFT\_TOKEN\_NAME. By default the cache store is set to `local`, but can be any cache store you have set up in your application and can be overridden by INFUSIONSOFT\_CACHE. The default cache store is `file`, but can be any cache store you have set up.

For multiple account connections, the account keys will be appended to the `infusionsoft.token` name, for example:

```
infusionsoft.token.account1

```

Refresh Access Tokens
---------------------

[](#refresh-access-tokens)

While this package helps with keeping access tokens refreshed using refresh tokens, there may be instances where this is not best practice. For example, in an environment where the application is load balanced between two or more servers. It is entirely possible during the refresh action, one call could use an expired or invalid access token. To remedy this, a scheduled command is preferred.

```
php artisan infusionsoft::token-refresh
```

Since Infusionsoft access tokens expire after 24 hours it is recommended to refresh the access tokens twice a day. A command is already registered to be used by your application. However, you will need to schedule it in your `Console/Kernel.php` file.

```
$schedule->command('infusionsoft:token-refresh')->twiceDaily(5, 17);
```

Try
---

[](#try)

There may be instances where Infusionsoft just fails an API call (happens often enough) and I've always struggled with constantly creating do/while or while loops all the time. In V4.2.0 I have introduces a `try` method to help alleviate this burden.

The method:

```
public function try(callable $callback, int $max_tries = 5, int $sleep = 2);
```

An example:

```
$infusionsoft = new \Binfotech\Infusionsoft\Infusionsoft('inf1');

$affiliate = collect([
    'ContactId' => $contactId,
    'Status' => 1,
    'AffName' => 'Test Rat',
    'AffCode' => 'testrat',
]);

$external_id = $infusionsoft->try(function () use ($infusionsoft, $affiliate) {
    return $infusionsoft->data()->add('Affiliate', $affiliate->toArray());
});
```

Laravel ships with a `retry` function, however, the `try` method sends the instance of the class and the number of tries back through the callback function in case they are needed. So another way it could be written:

```
$external_id = $infusionsoft->try(function ($self, $try_count) use ($affiliate) {
    return $self->data()->add('Affiliate', $affiliate->toArray());
});
```

Lumen
=====

[](#lumen)

Register the service provider

```
$app->register(Binfotech\Infusionsoft\InfusionsoftLumenServiceProvider::class);
```

Add Infusionsoft configuration `bootstrap/app.php`

```
// Add the ability to read the `infusionsoft` config file
$app->configure('infusionsoft');
```

Activate filesystems

`config/filesystems.php`

See a sample filesystems.php config file.

Add our configuration `bootstrap/app.php`

```
...

$app->configure('filesystems');

...

$app->singleton(
    Illuminate\Contracts\Filesystem\Factory::class,
    function ($app) {
        return new Illuminate\Filesystem\FilesystemManager($app);
    }
);
...
```

Add Infusionsoft facade (optional)

```
class_alias(Binfotech\Infusionsoft\InfusionsoftFacade::class, 'Infusionsoft');
```

> ⚠️ For multiple account connections, the `InfusionsoftFacade` will not longer work.

You must invoke the class directly:

```
$inf = new \Binfotech\Infusionsoft\Infusionsoft('account1');
```

[Buy me a coffee](https://www.buymeacoffee.com/binfotech) ☕

License
-------

[](#license)

Binfotech/Infusionsoft &amp; Infusionsoft SDK is free software distributed under the terms of the MIT license.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5cb6971aa61b97d0a51bc570a3f27722185f1e0a13a7bc9e01170903502d99b2?d=identicon)[binfotech](/maintainers/binfotech)

---

Top Contributors

[![dbajwa763](https://avatars.githubusercontent.com/u/15089801?v=4)](https://github.com/dbajwa763 "dbajwa763 (2 commits)")

### Embed Badge

![Health badge](/badges/binfotech-laravel-infusionsoft/health.svg)

```
[![Health](https://phpackages.com/badges/binfotech-laravel-infusionsoft/health.svg)](https://phpackages.com/packages/binfotech-laravel-infusionsoft)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
