PHP code example of upwebdesign / laravel-infusionsoft

1. Go to this page and download the library: Download upwebdesign/laravel-infusionsoft library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

upwebdesign / laravel-infusionsoft example snippets


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

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

$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());
});

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

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

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


...

$app->configure('filesystems');

...

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

class_alias(Upwebdesign\Infusionsoft\InfusionsoftFacade::class, 'Infusionsoft');

$inf = new \Upwebdesign\Infusionsoft\Infusionsoft('account1');
shell
php artisan vendor:publish --provider="Upwebdesign\Infusionsoft\InfusionsoftServiceProvider" --tag="config"
shell
php artisan infusionsoft::token-refresh