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

ActiveLibrary[API Development](/categories/api)

rossjcooper/laravel-hubspot
===========================

Adds a Laravel specific wrapper for the Hubspot client package

6.0.0(2y ago)65696.6k—6.9%29[1 issues](https://github.com/rossjcooper/laravel-hubspot/issues)[1 PRs](https://github.com/rossjcooper/laravel-hubspot/pulls)MITPHPPHP &gt;=8.0

Since Sep 18Pushed 2y ago4 watchersCompare

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

READMEChangelog (5)Dependencies (4)Versions (18)Used By (0)

HubSpot PHP API Client Wrapper for Laravel
==========================================

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

[![Latest Stable Version](https://camo.githubusercontent.com/55dbc602a61f1d0bef4ce17880fd18540a20beb6c0c940ebf1cf6f65c0f8fe24/68747470733a2f2f706f7365722e707567782e6f72672f726f73736a636f6f7065722f6c61726176656c2d68756273706f742f762f737461626c65)](https://packagist.org/packages/rossjcooper/laravel-hubspot) [![Total Downloads](https://camo.githubusercontent.com/a14649492454918247110226af0212135572fd8b81e323ed964e38735eac18ba/68747470733a2f2f706f7365722e707567782e6f72672f726f73736a636f6f7065722f6c61726176656c2d68756273706f742f646f776e6c6f616473)](https://packagist.org/packages/rossjcooper/laravel-hubspot)

This is a wrapper for the [Hubspot/hubspot-api-php](https://github.com/HubSpot/hubspot-api-php) package and gives the user a Service Container binding and facade of the `HubSpot\Discovery\Discovery` class.

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

[](#installation)

1. `composer require rossjcooper/laravel-hubspot`
2. Get a HubSpot API Key from the Intergrations page of your HubSpot account.
3. Laravel 5.4 or earlier, in your `config/app.php` file:
    - Add `Rossjcooper\LaravelHubSpot\HubSpotServiceProvider::class` to your providers array.
    - Add `'HubSpot' => Rossjcooper\LaravelHubSpot\Facades\HubSpot::class` to your aliases array.
4. `php artisan vendor:publish --provider="Rossjcooper\LaravelHubSpot\HubSpotServiceProvider" --tag="config"` will create a `config/hubspot.php` file.
5. Add your HubSpot API key and private app access token into the `.env` file: `HUBSPOT_ACCESS_TOKEN=yourApiKey`
6. If you use the private app access token, you should alo add `HUBSPOT_USE_OAUTH2=true` to your `.env` file

Usage
-----

[](#usage)

You can use either the facade or inject the HubSpot class as a dependency:

### Facade

[](#facade)

```
// Echo all contacts first and last names
$response = HubSpot::crm()->contacts()->basicApi()->getPage();
    foreach ($response->getResults() as $contact) {
        echo sprintf(
            "Contact name is %s %s." . PHP_EOL,
            $contact->getProperties()['firstname'],
            $contact->getProperties()['lastname']
        );
    }
```

```
Route::get('/', function (HubSpot\Discovery\Discovery $hubspot) {
    $response = $hubspot->crm()->contacts()->basicApi()->getPage();
    foreach ($response->getResults() as $contact) {
        echo sprintf(
            "Contact name is %s %s." . PHP_EOL,
            $contact->getProperties()['firstname'],
            $contact->getProperties()['lastname']
        );
    }
});
```

```
// Create a new contact
$contactInput = new \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInputForCreate();
$contactInput->setProperties([
    'email' => 'example@example.com'
]);

$contact = $hubspot->crm()->contacts()->basicApi()->create($contactInput);
```

For more info on using the actual API see the main repo [Hubspot/hubspot-api-php](https://github.com/HubSpot/hubspot-api-php)

Testing
-------

[](#testing)

We're using the brilliant [Orchestra Testbench](https://github.com/orchestral/testbench) to run unit tests in a Laravel based environment. If you wish to run tests be sure to have a HubSpot API key inside your `.env` file and run `composer run test`

Current unit test access the HubSpot API and expect to see the demo contacts/leads that HubSpot provides to its developer accounts.

Issues
------

[](#issues)

Please only report issues relating to the Laravel side of things here, main API issues should be reported [here](https://github.com/HubSpot/hubspot-api-php/issues)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 81.7% 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 ~176 days

Recently: every ~316 days

Total

15

Last Release

1057d ago

Major Versions

1.3.0 → 2.0.02020-01-07

2.0.0 → 3.0.02020-02-09

3.0.0 → 4.0.02020-10-15

4.0.0 → 5.0.02022-11-12

5.0.0 → 6.0.02023-06-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/0656ac2c71910f47f1d565d0f1f390d76e476faff7ce13f6e455408c659a4151?d=identicon)[rossjcooper](/maintainers/rossjcooper)

---

Top Contributors

[![rossjcooper](https://avatars.githubusercontent.com/u/3597958?v=4)](https://github.com/rossjcooper "rossjcooper (67 commits)")[![mtmail](https://avatars.githubusercontent.com/u/3727288?v=4)](https://github.com/mtmail "mtmail (5 commits)")[![omacranger](https://avatars.githubusercontent.com/u/3063830?v=4)](https://github.com/omacranger "omacranger (2 commits)")[![wgriffioen](https://avatars.githubusercontent.com/u/53269?v=4)](https://github.com/wgriffioen "wgriffioen (2 commits)")[![brenthays](https://avatars.githubusercontent.com/u/4601896?v=4)](https://github.com/brenthays "brenthays (2 commits)")[![limatheus](https://avatars.githubusercontent.com/u/5197254?v=4)](https://github.com/limatheus "limatheus (1 commits)")[![callmetwan](https://avatars.githubusercontent.com/u/526768?v=4)](https://github.com/callmetwan "callmetwan (1 commits)")[![chrispecoraro](https://avatars.githubusercontent.com/u/307660?v=4)](https://github.com/chrispecoraro "chrispecoraro (1 commits)")[![benyanke](https://avatars.githubusercontent.com/u/4274911?v=4)](https://github.com/benyanke "benyanke (1 commits)")

---

Tags

hacktoberfesthubspot-apihubspot-phplaravelapilaravelhubspotservice

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[specialtactics/l5-api

Dependencies for the Laravel API Boilerplate package

3672.8k2](/packages/specialtactics-l5-api)

PHPackages © 2026

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