tutorauk / laravel-braze-api
A Laravel client for the Braze REST API
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0.1
- guzzlehttp/psr7: ^2.3
- illuminate/contracts: ^9.0|^10.0
- immobiliarelabs/braze-sdk: ^2.1
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^6.1|^7.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0|^8.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5|^10
This package is not auto-updated.
Last update: 2024-09-06 00:08:15 UTC
README
Laravel wrapper around the immobiliare/braze-php-sdk package.
Installation
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
Http Client Adapters
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
Usage
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();
Testing, Static Analysis and Formatting
composer test
composer analyse
composer format
Thanks
Big shout out to Immobiliare Labs for their Braze PHP SDK package. They did all the hard work 👏!
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
License
The MIT License (MIT). Please see License File for more information.