Skip to content

Commit

Permalink
dont bind facade if disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
scott grayson authored and scott grayson committed Jul 11, 2024
1 parent ee88ca5 commit 6821623
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/LaravelHubspotServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ public function configurePackage(Package $package): void

public function bootingPackage()
{
if (config('hubspot.disabled')) {
return;
}

$this->app->bind(LaravelHubspot::class, function ($app) {

$stack = new HandlerStack();
$stack->setHandler(Utils::chooseHandler());

$stack->push(Middleware::mapRequest(function (RequestInterface $r) {
if (config('hubspot.log_requests')) {
\Log::info('Hubspot Request: '.$r->getMethod().' '.$r->getUri());
\Log::info('Hubspot Request: ' . $r->getMethod() . ' ' . $r->getUri());
}

return $r;
Expand Down

0 comments on commit 6821623

Please sign in to comment.