PHPackages                             visualbuilder/filament-hubspot - 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. visualbuilder/filament-hubspot

ActiveLibrary[API Development](/categories/api)

visualbuilder/filament-hubspot
==============================

Syncs leads from HubSpot

5.0.3(3mo ago)04.6k↑42.4%[1 PRs](https://github.com/visualbuilder/filament-hubspot/pulls)MITPHPPHP ^8.2CI failing

Since Mar 14Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/visualbuilder/filament-hubspot)[ Packagist](https://packagist.org/packages/visualbuilder/filament-hubspot)[ Docs](https://github.com/visualbuilder/filament-hubspot)[ GitHub Sponsors]()[ RSS](/packages/visualbuilder-filament-hubspot/feed)WikiDiscussions 5.x Synced yesterday

READMEChangelogDependencies (19)Versions (17)Used By (0)

Filament HubSpot Integration
============================

[](#filament-hubspot-integration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/95c086a8c7f95dfdcd37ac4a75323f1388fcd84ff660819296beb0082992c301/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76697375616c6275696c6465722f66696c616d656e742d68756273706f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/visualbuilder/filament-hubspot)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9acfaf17ce927714c4ba14c3b025c81cd35001b0ef171d7a6035c59cad48efc5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76697375616c6275696c6465722f66696c616d656e742d68756273706f742f72756e2d74657374732e796d6c3f6272616e63683d352e78266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/visualbuilder/filament-hubspot/actions?query=workflow%3Arun-tests+branch%3A5.x)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a4f75f4701407fc0e671d9dc7867a95bda045cb15a9a898d4e73269fd4f75835/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76697375616c6275696c6465722f66696c616d656e742d68756273706f742f6669782d7068702d636f64652d7374796c696e672e796d6c3f6272616e63683d352e78266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/visualbuilder/filament-hubspot/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3A5.x)[![Total Downloads](https://camo.githubusercontent.com/b3797281fe10cabc019e2655d4317cec80fae9e195a5cdca0f6c7b27247e2d60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76697375616c6275696c6465722f66696c616d656e742d68756273706f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/visualbuilder/filament-hubspot)

📌 Overview
----------

[](#-overview)

This package provides:

- A **Laravel Facade wrapper** for the [HubSpot API PHP Library](https://github.com/HubSpot/hubspot-api-php).
- A **customizable webhook** (`/api/hubspot/webhook`) to receive **contact updates** from HubSpot.
- An **event-driven sync system** (`SyncHubspotContactListener`) to automatically sync contacts from HubSpot to Laravel.

This package is a **quick-start solution** for integrating **HubSpot contacts** into a **Laravel + Filament** sales pipeline.

Version Compatibility
---------------------

[](#version-compatibility)

Package VersionFilamentLaravelPHP5.x5.x11.x, 12.x8.2+4.x4.x10.x, 11.x8.2+---

🚀 Installation
--------------

[](#-installation)

Install the package via Composer:

```
# For Filament 5.x
composer require visualbuilder/filament-hubspot:^5.0

# For Filament 4.x
composer require visualbuilder/filament-hubspot:^4.0
```

Publish the config file:-

```
php artisan vendor:publish --tag="filament-hubspot-config"
```

If you wish to use the provided lead model then run the install command to setup the migration

```
php artisan filament-hubspot:install
```

🔑 HubSpot API Setup
-------------------

[](#-hubspot-api-setup)

### 1️⃣ **Obtain HubSpot API Credentials**

[](#1️⃣-obtain-hubspot-api-credentials)

1. Go to **HubSpot &gt; Settings &gt; Account Management &gt; Integrations**.
2. Navigate to **Connected Apps** or **Private Apps**.
3. Generate an **Access Token** and **Client Secret**.

### 2️⃣ **Add credentials to `.env`**

[](#2️⃣-add-credentials-to-env)

```
HUBSPOT_ACCESS_TOKEN=pat-eu1-xxxxx
HUBSPOT_CLIENT_SECRET=xxxxx-xxx-xxxxx
```

Testing the connection. The HubSpot API should now be available on the HubSpot Facade. You can test with tinker or in a console command:-

```
    $response = HubSpot::crm()->contacts()->basicApi()->getPage();
    foreach ($response->getResults() as $contact) {
         dump($contact->getProperties());
    }
```

Webhook
-------

[](#webhook)

On your app, add the events that should trigger a webhook and point to `yourdomain.com/api/hubspot/webhook`

### Local Webhook testing

[](#local-webhook-testing)

For local testing of webhooks use ngrok or smee to route requests to your local server

```
 ngrok http localhost:80
```

Which should provide a url which can be used in HubSpot:-

```
Forwarding  https://a5ed-18-170-5-16.ngrok-free.app -> http://localhost:80
```

Paste this URL into the Hubspot App webhooks section and define your events to trigger call. On this page you can send a test webhook.

Ngrok should output something like

```
05:20:45.763 GMT POST /api/hubspot/webhook      200 OK
```

This indicates the POST has been received and validated and the `HubspotWebhookReceived` Event will be triggered

The provided `SyncHubspotContactListener` will be called each time the Webhook is received.

Add your own custom Listeners in the config

```
        /**
         * What to do when a webhook is received
         */
        'listeners'           => [
            Visualbuilder\FilamentHubspot\Events\HubspotWebhookReceived::class => [
                Visualbuilder\FilamentHubspot\Listeners\SyncHubspotContactListener::class,
                // Additional listeners can be added here...
            ],
        ],
```

If you are getting 401 Unauthorized, check the keys and your server time. Valid requests must be within 5 minutes so clocks must be correct.

### Synching a local model

[](#synching-a-local-model)

Set your model that should receive the HubSpot Contact and set which attributes to update.

```
   /*
    |--------------------------------------------------------------------------
    | HubSpot Webhook Options
    |--------------------------------------------------------------------------
    |  Enabling adds a route at /api/hubspot/webhook
    |  Valid requests will trigger an event HubspotWebhookReceived
    |
    */
    'webhook'           => [
        'enabled'             => env('HUBSPOT_WEBHOOK_ENABLED', true),
        'slug'                => env('HUBSPOT_WEBHOOK_SLUG', 'api/hubspot/webhook'),

        /**
         * Replace this with your own Contact Model preference
         */
        'local_contact_model' => \App\Models\Lead::class,
        'match_on_attribute'  => [
            'hubspot'    => 'email',
            'localModel' => 'email'
        ],
```

### Set field mapping

[](#set-field-mapping)

```
 /*
     |--------------------------------------------------------------------------
     | HubSpot Contact to local Model mappings
     |--------------------------------------------------------------------------
     |  Setup hubspot fields =>  model attribute mapping
     |  These fields will be requested from hubspot, the values are the model mappings
     |
     */
    'mappings'          => [
        'firstname'        => ['attribute' => 'first_name'],
        'lastname'         => ['attribute' => 'last_name'],
        'email'            => ['attribute' => 'email'],
        'company'          => ['attribute' => 'company'],
        'website'          => ['attribute' => 'website'],
        'jobtitle'         => ['attribute' => 'job_title'],
        'message'          => ['attribute' => 'message'],
        'lastmodifieddate' => ['attribute' => 'updated_at'],
        'lifecyclestage'   => ['attribute' => null],
        'hs_object_id'     => ['attribute' => 'hs_id'],

        // Relations can be added and auto created if not existing
        // in this case leadsource may contain LinkedIn, Facebook etc as a string and will populate a related model if the source is not found
        'leadsource'       => [
            'relation'         => 'leadSource',
            'lookup_field'     => 'name',           // the column to find or create related model
            'foreign_key'      => 'lead_source_id', // optional, otherwise inferred automatically
            'not_found_action' => 'create',         // use ignore or create missing lookup relation
        ],
    ],
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Lee Evans](https://github.com/visualbuilder)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance84

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72% 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 ~36 days

Recently: every ~5 days

Total

12

Last Release

73d ago

Major Versions

1.0.1 → 4.0.12025-08-19

1.x-dev → 5.0.02026-03-31

4.0.3 → 5.x-dev2026-04-21

PHP version history (2 changes)1.0.0PHP ^8.1

4.0.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/98528425?v=4)[Eko UK Limited](/maintainers/ekoukltd)[@ekoukltd](https://github.com/ekoukltd)

---

Top Contributors

[![cannycookie](https://avatars.githubusercontent.com/u/500822?v=4)](https://github.com/cannycookie "cannycookie (18 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelvisual builderfilament-hubspot

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/visualbuilder-filament-hubspot/health.svg)

```
[![Health](https://phpackages.com/badges/visualbuilder-filament-hubspot/health.svg)](https://phpackages.com/packages/visualbuilder-filament-hubspot)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-feature-flags

Filament implementation of feature flags and segmentation with Laravel Pennant.

122177.8k1](/packages/stephenjude-filament-feature-flags)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-debugger

About

104162.2k2](/packages/stephenjude-filament-debugger)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)

PHPackages © 2026

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