PHP code example of vansteen / laravel-sendinblue

1. Go to this page and download the library: Download vansteen/laravel-sendinblue 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/ */

    

vansteen / laravel-sendinblue example snippets


// config/app.php
'providers' => [
    ...
    Vansteen\Sendinblue\SendinblueServiceProvider::class,
    ...
];

// config/app.php
'aliases' => [
    ...
    'Sendinblue' => Vansteen\Sendinblue\Facades\Sendinblue::class,
];

// routes.php
...
use Vansteen\Sendinblue\Facades\Sendinblue;

Route::get('/test', function () {

    // Configure API keys authorization according to the config file
    $config = Sendinblue::getConfiguration();

    // Uncomment below to setup prefix (e.g. Bearer) for API keys, if needed
    // $config->setApiKeyPrefix('api-key', 'Bearer');
    // $config->setApiKeyPrefix('partner-key', 'Bearer');

    $apiInstance = new \SendinBlue\Client\Api\ListsApi(
        // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
        // This is optional, `GuzzleHttp\Client` will be used as default.
        new GuzzleHttp\Client(),
        $config
    );

    try {
        $result = $apiInstance->getLists();
        dd($result);
    } catch (Exception $e) {
        echo 'Exception when calling AccountApi->getAccount: ', $e->getMessage(), PHP_EOL;
    }

});
bash
php artisan vendor:publish --tag=sendinblue.config