PHPackages                             upwebdesign/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. upwebdesign/laravel-infusionsoft

ActiveLibrary[API Development](/categories/api)

upwebdesign/laravel-infusionsoft
================================

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

v4.2.0(4y ago)246.3k↑183.3%10[1 PRs](https://github.com/upwebdesign/laravel-infusionsoft/pulls)MITPHPPHP &gt;=7.2

Since May 15Pushed 2y ago2 watchersCompare

[ Source](https://github.com/upwebdesign/laravel-infusionsoft)[ Packagist](https://packagist.org/packages/upwebdesign/laravel-infusionsoft)[ RSS](/packages/upwebdesign-laravel-infusionsoft/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (21)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/0757d4f5b17af2d8a8a2a44ec77e70556e2482a260ecd61967f625907bdcc1d4/68747470733a2f2f706f7365722e707567782e6f72672f757077656264657369676e2f6c61726176656c2d696e667573696f6e736f66742f646f776e6c6f6164732e7376673f666f726d61743d666c6174)](https://packagist.org/packages/upwebdesign/laravel-infusionsoft)[![Latest Stable Version](https://camo.githubusercontent.com/b18eb181a921db93f4ddc5c157d5c97f25cf72eecab6c10db3c8a37036e633b3/68747470733a2f2f706f7365722e707567782e6f72672f757077656264657369676e2f6c61726176656c2d696e667573696f6e736f66742f762f737461626c652e7376673f666f726d61743d666c6174)](https://packagist.org/packages/upwebdesign/laravel-infusionsoft)

Laravel Infusionsoft
====================

[](#laravel-infusionsoft)

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

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 upwebdesign/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`.

```
Upwebdesign\Infusionsoft\InfusionsoftServiceProvider::class,

```

in the `providers` array and optionally

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

```

to the `aliases` array.

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

[](#configuration)

Publish `infusionsoft.php` config file.

```
php artisan vendor:publish --provider="Upwebdesign\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 `file`, but can be any cache store you have set up in your application and can be overridden by INFUSIONSOFT\_CACHE.

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 \Upwebdesign\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(Upwebdesign\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(Upwebdesign\Infusionsoft\InfusionsoftFacade::class, 'Infusionsoft');
```

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

You must invoke the class directly:

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

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

License
-------

[](#license)

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

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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.

###  Release Activity

Cadence

Every ~134 days

Recently: every ~38 days

Total

20

Last Release

1469d ago

Major Versions

v0.1-alpha → v1.02015-06-11

1.1.x-dev → v2.0.02019-03-25

1.0.x-dev → v3.0.02020-04-15

2.0.x-dev → 4.0.02020-09-21

PHP version history (6 changes)v0.1-alphaPHP &gt;=5.4.0

v1.0.1PHP &gt;=5.5.0

v1.1.0PHP &gt;=5.6.0

v3.0.0PHP ^7.2

v4.1.1PHP ^7.2|^8.0

v4.1.2PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/92a6fe0d542ddb3b01670329a0ca08302bc49db996a0840ad1c87824a6a7e509?d=identicon)[upwebdesign](/maintainers/upwebdesign)

---

Top Contributors

[![upwebdesign](https://avatars.githubusercontent.com/u/1845130?v=4)](https://github.com/upwebdesign "upwebdesign (100 commits)")[![arivazhaganark](https://avatars.githubusercontent.com/u/10572131?v=4)](https://github.com/arivazhaganark "arivazhaganark (2 commits)")[![adriallongarriu](https://avatars.githubusercontent.com/u/20278289?v=4)](https://github.com/adriallongarriu "adriallongarriu (1 commits)")

---

Tags

laravelsdkinfusionsoftisdk

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[google-gemini-php/laravel

Google Gemini PHP for Laravel is a supercharged PHP API client that allows you to interact with the Google Gemini AI API

614397.1k4](/packages/google-gemini-php-laravel)[kyon147/laravel-shopify

Shopify package for Laravel to aide in app development

473252.9k](/packages/kyon147-laravel-shopify)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

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