### Install Laravel Klaviyo via Composer Source: https://github.com/jeffersongoncalves/laravel-klaviyo/blob/main/README.md Install the Laravel Klaviyo package via Composer. Run this in your project root to add the package as a dependency. ```bash composer require jeffersongoncalves/laravel-klaviyo ``` -------------------------------- ### Configure Klaviyo API Key in .env Source: https://github.com/jeffersongoncalves/laravel-klaviyo/blob/main/README.md Set your Klaviyo private API key in the .env file. Replace the placeholder with your actual key. ```env KLAVIYO_API_KEY=pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` -------------------------------- ### Publish Klaviyo Config File Source: https://github.com/jeffersongoncalves/laravel-klaviyo/blob/main/README.md Optionally publish the package's config file to your application. Use this command to customize the configuration. ```bash php artisan vendor:publish --tag="klaviyo-config" ``` -------------------------------- ### Run Laravel Klaviyo Tests Source: https://github.com/jeffersongoncalves/laravel-klaviyo/blob/main/README.md Run the package's test suite via Composer. Use this command to execute all tests. ```bash composer test ``` -------------------------------- ### Use LaravelKlaviyo Facade for API Operations Source: https://github.com/jeffersongoncalves/laravel-klaviyo/blob/main/README.md Shows the main usage of the LaravelKlaviyo facade for profiles, lists, events, campaigns, flows, metrics, segments, and templates. All methods throw LaravelKlaviyoException on a failed API response. ```php use Jeffersongoncalves\LaravelKlaviyo\Facades\LaravelKlaviyo; // Profiles LaravelKlaviyo::createProfile(['email' => 'user@example.com', 'first_name' => 'Jane']); LaravelKlaviyo::getProfile($id); LaravelKlaviyo::updateProfile($id, ['first_name' => 'Jane']); LaravelKlaviyo::listProfiles(['filter' => 'equals(email,"user@example.com")']); // Lists $list = LaravelKlaviyo::createList('Newsletter'); LaravelKlaviyo::addProfilesToList($list['data']['id'], [$profileId]); LaravelKlaviyo::removeProfilesFromList($list['data']['id'], [$profileId]); LaravelKlaviyo::deleteList($list['data']['id']); // Events LaravelKlaviyo::createEvent('Placed Order', 'user@example.com', ['order_id' => 123], value: 49.90); // Campaigns, Flows, Metrics, Segments, Templates LaravelKlaviyo::listCampaigns(); LaravelKlaviyo::listFlows(); LaravelKlaviyo::updateFlow($flowId, 'live'); LaravelKlaviyo::listMetrics(); LaravelKlaviyo::listSegments(); LaravelKlaviyo::listTemplates(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.