Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lara279089's avatar

how to integrate klaviyo with Laravel?

Please anyone help me, how to integrate Klaviyo with Larave??

0 likes
2 replies
tisuchi's avatar

@mohib Integrating Klaviyo with Laravel involves a few steps:

  1. First, sign up for a Klaviyo account and create an API key.

  2. Next, install the Klaviyo PHP library using Composer by running the command:

composer require klaviyo/klaviyo-php
  1. In your Laravel application, create a service provider that will handle the initialization of the Klaviyo client. In the boot method of the service provider, you can use the Klaviyo API key to initialize the client and make it available through the application's service container.

  2. You can use the Klaviyo client in your controller or other parts of the application to perform operations such as adding or updating subscribers, creating and sending campaigns, and more.

  3. You can also use Klaviyo's webhooks to track events in your application and trigger automation workflows or segmentation.

Here is an example of how you can use the Klaviyo client to subscribe a user to a list:

$klaviyo = app('klaviyo');
$klaviyo->lists()->subscribe($list_id, $email, ['first_name' => 'John', 'last_name' => 'Doe']);

Check more: https://developers.klaviyo.com/en/docs

Please or to participate in this conversation.