1. Go to this page and download the library: Download tapp/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/ */
tapp / laravel-hubspot example snippets
use Tapp\LaravelHubspot\Models\HubspotContact;
class User extends Authenticatable
{
use HubspotContact;
public array $hubspotMap = [
'email' => 'email',
'first_name' => 'first_name',
'last_name' => 'last_name',
'user_type' => 'type.name', // Supports dot notation for relations
];
}
use App\Models\User;
use App\Models\Company;
use Tapp\LaravelHubspot\Observers\HubspotContactObserver;
use Tapp\LaravelHubspot\Observers\HubspotCompanyObserver;
public function boot(): void
{
User::observe(HubspotContactObserver::class);
Company::observe(HubspotCompanyObserver::class);
}