PHPackages                             eolica/laravel-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. eolica/laravel-hubspot

ActiveLibrary[API Development](/categories/api)

eolica/laravel-hubspot
======================

Laravel wrapper for the Hubspot PHP client package

v1.4.0(2mo ago)14.2k↓22.2%1[1 issues](https://github.com/Eolica-Web/laravel-hubspot/issues)MITPHPPHP &gt;=8.0

Since Oct 29Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Eolica-Web/laravel-hubspot)[ Packagist](https://packagist.org/packages/eolica/laravel-hubspot)[ Docs](https://github.com/Eolica-Web/laravel-hubspot)[ RSS](/packages/eolica-laravel-hubspot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (7)Used By (0)

Laravel wrapper for the HubSpot API PHP Client
==============================================

[](#laravel-wrapper-for-the-hubspot-api-php-client)

[![Latest Version on Packagist](https://camo.githubusercontent.com/254e4f753f6bb449999b12ed2e6f6f1dee9cb8b62bccdc3ebdf147c7b653ae0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656f6c6963612f6c61726176656c2d68756273706f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eolica/laravel-hubspot) [![Total Downloads](https://camo.githubusercontent.com/a30083e4bb2944a187000cee9d50cf2ce0bb154943fceac0a27736a7c4a59603/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656f6c6963612f6c61726176656c2d68756273706f742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/eolica/laravel-hubspot)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

Installation
------------

[](#installation)

You can install the package via [Composer](https://getcomposer.org/):

```
composer require eolica/laravel-hubspot
```

Once installed, if you are not using automatic [package discovery](https://laravel.com/docs/8.x/packages#package-discovery), then you need to register the `Eolica\LaravelHubspot\HubspotServiceProvider` service provider in your `config/app.php`.

```
'providers' => [
    ...

    /*
    * Package Service Providers...
    */
    Eolica\LaravelHubspot\HubspotServiceProvider::class,

    ...
],
```

You can also optionally alias our facade:

```
'aliases' => [
    ...

    'Hubspot' => Eolica\LaravelHubspot\Facades\Hubspot::class,

],
```

Configuration
-------------

[](#configuration)

This package makes use of the [Laravel Manager Package](https://github.com/GrahamCampbell/Laravel-Manager) by [Graham Campbell](https://github.com/GrahamCampbell) that allows us to configure and use multiple connections of the HubSpot API in the same application.

To get started, you will need to publish the hubspot config file

```
php artisan vendor:publish --provider="Eolica\LaravelHubspot\HubspotServiceProvider" --tag="config"
```

This will create a `config/hubspot.php` file in your app that you can modify to set your configuration.

This is an example of the config file:

```
return [
    'default' => 'main',

    'connections' => [
        'main' => [
            'config' => [
                'key' => '',
            ],
            'retry_middleware' => [
                'rate_limit' => 'constant:5',
                'internal_errors' => 'exponential:2'
            ],
            'client_options' => [
                'http_errors' => true,
            ],
            'wrap_response' => true,
        ],

        'alternative' => [
            'config' => [
                'key' => '',
                'oauth' => true,
            ],
            'retry_middleware' => [
                'rate_limit' => 'linear',
            ],
            'client_options' => [
                'http_errors' => true,
            ],
            'wrap_response' => true,
        ],
    ],
];
```

##### Default Connection Name

[](#default-connection-name)

This option (`'default'`) is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `'main'`.

##### HubSpot Connections

[](#hubspot-connections)

This option (`'connections'`) is where each of the connections are setup for your application. You may add as many connections as you would like.

Usage
-----

[](#usage)

##### HubspotManager

[](#hubspotmanager)

This is the class of most interest. It is bound to the ioc container as `'hubspot'` and can be accessed using the `Facades\Hubspot` facade. This class implements the ManagerInterface by extending AbstractManager. The interface and abstract class are both part of [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package, so you may want to go and checkout the docs for how to use the manager class over at that repo.

##### Facades\\Hubspot

[](#facadeshubspot)

This facade will dynamically pass static method calls to the `'hubspot'` object in the ioc container which by default is the HubspotManager class.

##### HubspotServiceProvider

[](#hubspotserviceprovider)

This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

### Examples

[](#examples)

```
use Eolica\LaravelHubspot\Facades\Hubspot;

Hubspot::contacts()->getByEmail("test@hubspot.com");

Hubspot::contacts()->all([
    'count'     => 10,
    'property'  => ['firstname', 'lastname'],
    'vidOffset' => 123456,
]);
```

The hubspot manager will behave like it is a `\SevenShores\Hubspot\Factory` class. If you want to call specific connections, you can do it with the `connection` method:

```
use Eolica\LaravelHubspot\Facades\Hubspot;

Hubspot::connection('alternative')->contacts()->getByEmail("test@hubspot.com");

Hubspot::connection('alternative')->contacts()->all([
    'count'     => 10,
    'property'  => ['firstname', 'lastname'],
    'vidOffset' => 123456,
]);
```

```
use Eolica\LaravelHubspot\Facades\Hubspot;

// Writing this:
Hubspot::connection('main')->contacts()->getByEmail("test@hubspot.com");

// Is identical to writing this:
Hubspot::contacts()->getByEmail("test@hubspot.com");

// And is also identical to writing this:
Hubspot::connection()->contacts()->getByEmail("test@hubspot.com");

// This is because the 'main' connection is configured to be the default
Hubspot::getDefaultConnection(); // This will return 'main'

// We can change the default connection
Hubspot::setDefaultConnection('alternative'); // The default is now 'alternative'
```

If you prefer to use dependency injection over facades, then you can easily inject the manager like so:

```
use Illuminate\Support\Facades\App;
use Eolica\LaravelHubspot\HubspotManager;

final class Example
{
    private $hubspot;

    public function __construct(HubspotManager $hubspot)
    {
        $this->hubspot = $hubspot;
    }

    public function method()
    {
        $this->hubspot->contacts()->getByEmail("test@hubspot.com");

        $this->hubspot->connection('alternative')->contacts()->getByEmail("test@hubspot.com");
    }
}

App::make(Example::class)->method();
```

For more information on how to use the `\SevenShores\Hubspot\Factory` class we are calling behind the scenes here, check out the docs at , and the manager class at .

Changelog
---------

[](#changelog)

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

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email at  instead of using the issue tracker.

License
-------

[](#license)

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

### Laravel Package Boilerplate

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance63

Regular maintenance activity

Popularity24

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~387 days

Recently: every ~318 days

Total

6

Last Release

85d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.2

v1.1.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ce7b6c97be6045063ccacafcc49a200b1066d5dfd5a125aec669687c1b8effb?d=identicon)[dllobell](/maintainers/dllobell)

---

Top Contributors

[![dllobell](https://avatars.githubusercontent.com/u/49846756?v=4)](https://github.com/dllobell "dllobell (8 commits)")

---

Tags

laravelhubspotlaravel-hubspoteolicahubspot phphubspot apihubspot laravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eolica-laravel-hubspot/health.svg)

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

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[rossjcooper/laravel-hubspot

Adds a Laravel specific wrapper for the Hubspot client package

65696.6k](/packages/rossjcooper-laravel-hubspot)[neuron-core/neuron-laravel

Official Neuron AI Laravel SDK.

10710.0k](/packages/neuron-core-neuron-laravel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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