PHP code example of artificertech / laravel-hubspot

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

    

artificertech / laravel-hubspot example snippets


return [

    /*
    |--------------------------------------------------------------------------
    | Default Hubspot Connection Name
    |--------------------------------------------------------------------------
    |
    | Here you may specify which of the hubspot connections below you wish
    | to use as your default connection for all HubSpot work. Of course
    | you may use many connections at once using the HubSpot library.
    |
    */

    'default' => env('HUBSPOT_CONNECTION', 'hubspot'),

    /*
    |--------------------------------------------------------------------------
    | HubSpot Connections
    |--------------------------------------------------------------------------
    |
    | Here are each of the HubSpot connections setup for your application.
    |
    */

    'connections' => [
        'hubspot' => [
            'token' => env('HUBSPOT_ACCESS_TOKEN'),
        ],
    ],

];

/** @var \HubSpot\Discovery\Discovery */
$hubspotDiscovery = \Artificertech\HubSpot\Facades\HubSpot::connection();
$hubspotDiscovery = \Artificertech\HubSpot\Facades\HubSpot::connection('hubspot');

/** @var \HubSpot\Discovery\Crm\Discovery */
$crm = $hubspotDiscovery->crm();

/** @var \HubSpot\Discovery\Crm\Discovery */
$crm = \Artificertech\HubSpot\Facades\HubSpot::crm();

\Artificertech\HubSpot\Facades\HubSpot::connected();

\Artificertech\HubSpot\Facades\HubSpot::connected('hubspot');
bash
php artisan vendor:publish --tag="laravel-hubspot-config"