This page walks through installing the package, binding a TokenProvider,
and making a first API call.
Installation
composer require artisanpack-ui/google-business-profile
The service provider and the GoogleBusinessProfile facade alias are
auto-registered via Laravel's package discovery. There is no migrate
step — the package holds no state of its own.
Prerequisites
Before the client can talk to the real Google Business Profile API you need:
- A Google Cloud project with the four Business Profile APIs enabled
(Account Management, Business Information,
mybusiness.googleapis.com, and Business Profile Performance). - Approval on the GBP API access request form.
Development against
Http::fake()does not require approval; production traffic does. - An OAuth access token issued for the
business.managescope. The package exposes this asScopes::BUSINESS_MANAGE.
Bind a TokenProvider
Every client accepts a TokenProvider and calls accessToken() on it
before each request. Bind whichever implementation fits your host:
use ArtisanPackUI\GoogleBusinessProfile\Contracts\TokenProvider;
$this->app->bind( TokenProvider::class, function () {
// In Keystone CMS, this resolves to GoogleOAuthManager. Anywhere
// else, wire up whatever exposes a fresh access token.
return new MyTokenProvider();
} );
See the TokenProvider guide for stub, cached,
and OAuth-backed examples.
Make your first call
Resolve any of the four clients from the container. The TokenProvider
and the shared Http factory are wired in automatically:
use ArtisanPackUI\GoogleBusinessProfile\AccountManagement\AccountManagementClient;
$client = app( AccountManagementClient::class );
$accounts = $client->listAccounts();
foreach ( $accounts->accounts as $account ) {
logger()->info( $account->name . ': ' . $account->accountName );
}
Every response is decoded into a typed DTO — AccountList, Location,
Review, and so on — under src/{Family}/DataTransferObjects/.
Next steps
- Learn how testing with
Http::fake()works and how the retry and error-mapping behaviour interacts with fakes. - Read the API-family map for the full list of methods exposed by each client.

