ausloans / laravel-hubspot
PHP HubSpot API wrapper for Laravel 5.5+.
v1.1.2
2019-06-25 06:27 UTC
Requires
- ausloans/hubspot: 1.0.*
README
HubSpot API package for Laravel 5.5+
This is a modified version of Fungku\HubSpot(https://packagist.org/packages/fungku/hubspot-php) to support Laravel version 5.5+. Most of the hard-working code is modified classes from HubSpot/haPiHP.
Setup
1.) install via composer
composer require ausloans/laravel-hubspot
2.) then run
php artisan vendor:publish --provider="Fungku\HubSpot\HubSpotServiceProvider"
3.) Open app/config/app.php
and add this to the providers array:
Fungku\HubSpot\HubSpotServiceProvider::class,
and on the Class Aliases add this
'HubSpot' => Fungku\HubSpot\Facades\HubSpot::class,
TO SET YOUR API KEY: Open your environment variables file(.env) and add this
HUBSPOT_KEY=YOUR_API_KEY_HERE
HUBSPOT_USER_AGENT=USER_AGENT_HERE
Examples
Contacts:
$contacts = HubSpot::contacts(); // Get 100 contacts $contacts->get_all_contacts(array('count'=>100)); // Get a contact by email address $contacts->get_contact_by_email('example@somedomain.com');
Lists
$lists = HubSpot::lists(); // Get 20 lists $lists->get_lists(array('count'=>20));