Laravel wrapper around the immobiliare/braze-php-sdk package.
You can install the package via composer:
composer require tutorauk/laravel-braze-api
Then you need to your Braze api key and the correct rest endpoint to your .env
file:
BRAZE_API_KEY='apiKey'
BRAZE_REST_ENDPOINT=https://rest.fra-02.braze.eu
This package has support for the Laravel HTTP Client or Guzzle. The Laravel HTTP Client is the default and preferred client. Utilising the Laravel client, enables you to take advantage of Laravels testing helpers within your tests.
If you would prefer to use Guzzle, you can specify the adapter in your .env
file:
BRAZE_CLIENT_ADAPTER=guzzle
This package binds a singleton to the Laravel service container, so you can easily resolve the Braze client directly from the container, or via dependency injection. Alternatively, the package also exposes both a Facade and a helper function should you prefer a shorter more expressive option.
// Resolve service directly from container and access the users endpoint
app(Braze::class)->users();
// Resolve via Facade and access the users endpoint
Braze::users();
// Resolve service via helper and access the users endpoint
braze()->users();
composer test
composer analyse
composer format
Big shout out to Immobiliare Labs for their Braze PHP SDK package. They did all the hard work 👏!
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.