tapp / laravel-hubspot
This is my package laravel-hubspot
Fund package maintenance!
TappNetwork
Installs: 1 014
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 1
Requires
- php: ^8.2
- hubspot/api-client: ^11.1
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2024-10-28 08:32:32 UTC
README
This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
composer require tappnetwork/laravel-hubspot
You can publish and run the migrations with:
php artisan vendor:publish --tag="hubspot-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-hubspot-config"
This is the contents of the published config file:
return [ 'api_key' => env('HUBSPOT_TOKEN'), 'log_requests' => env('HUBSPOT_LOG_REQUESTS', true), 'property_group' => env('HUBSPOT_PROPERTY_GROUP', 'app_user_profile'), 'property_group_label' => env('HUBSPOT_PROPERTY_GROUP_LABEL', 'App User Profile'), ];
Usage
API Key
Publish the config, add your api key to the env
User Model
Add the trait to your user model and define any fields to the $hubspotMap property that will determine the data sent to HubSpot. You may use dot notation to access data from relations. For further customization, use Laravel's accessor pattern
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', ];
Create HubSpot Properties
run the following command to create the property group and properties.
php artisan hubspot:sync-properties
Sync to HubSpot
The package uses model events to create or update contacts in HubSpot. Try registering a user and see that they have been created in HubSpot with properties from the $hubspotMap array.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- [TappNetwork](https://github.com/Scott Grayson)
- All Contributors
License
The MIT License (MIT). Please see License File for more information.