New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

knackline/laravel-listmonk

Laravel package for Listmonk API integration
1,007 4
Install
composer require knackline/laravel-listmonk
Latest Version:1.3.0
PHP:^8.0
Laravel:9 – 13
License:MIT
Last Updated:Oct 31, 2026
Links: GitHub  ·  Packagist
Maintainer: rajkumarsamra

Laravel Listmonk

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A Laravel package to interact with the Listmonk API, providing a fluent interface to manage subscribers, lists, campaigns, and more.

Features

  • 🚀 Full API coverage for Listmonk
  • 🔄 Fluent, object-oriented API
  • 🛠 Built with Laravel best practices
  • 📦 Easy installation and configuration
  • 🔍 Comprehensive test suite
  • 📝 Well-documented methods

Requirements

  • PHP 8.0 or higher (8.3+ on Laravel 13)
  • Laravel 9.x–13.x
  • Listmonk 2.0 or higher

Installation

You can install the package via Composer:

composer require knackline/laravel-listmonk

Publish the config file with:

php artisan vendor:publish --provider="Knackline\Listmonk\Providers\ListmonkServiceProvider" --tag="listmonk-config"

Configuration

Update your .env file with your Listmonk credentials:

LISTMONK_URL=https://your-listmonk-installation.com
LISTMONK_USERNAME=your-username
LISTMONK_PASSWORD=your-password

Or modify the config/listmonk.php file directly.

Usage

Facade

use Knackline\Listmonk\Facades\Listmonk;

// Get all subscribers
$subscribers = Listmonk::getSubscribers();

// Create a new subscriber
$subscriber = Listmonk::createSubscriber([
    'email' => 'user@example.com',
    'name' => 'John Doe',
    'status' => 'enabled',
    'lists' => [1, 2], // List IDs to subscribe to
]);

Dependency Injection

use Knackline\Listmonk\ListmonkClient;

class YourController
{
    protected $listmonk;

    public function __construct(ListmonkClient $listmonk)
    {
        $this->listmonk = $listmonk;
    }

    public function index()
    {
        $subscribers = $this->listmonk->getSubscribers();
        // ...
    }
}

Available Methods

Subscribers
  • getSubscribers(array $filters = []) - Get all subscribers
  • getSubscriber(int $id) - Get a subscriber by ID
  • createSubscriber(array $data) - Create a new subscriber
  • updateSubscriber(int $id, array $data) - Update a subscriber
  • deleteSubscriber(int $id) - Delete a subscriber
  • blocklistSubscriber(int $id) - Blocklist a subscriber
Lists
  • getLists(array $filters = []) - Get all lists
  • getList(int $id) - Get a list by ID
  • createList(array $data) - Create a new list
  • updateList(int $id, array $data) - Update a list
  • deleteList(int $id) - Delete a list
Campaigns
  • getCampaigns(array $filters = []) - Get all campaigns
  • getCampaign(int $id) - Get a campaign by ID
  • createCampaign(array $data) - Create a new campaign
  • updateCampaign(int $id, array $data) - Update a campaign
  • deleteCampaign(int $id) - Delete a campaign
  • sendCampaign(int $campaignId, bool $sendNow = false) - Send a campaign
Templates
  • getTemplates() - Get all templates
  • getTemplate(int $id) - Get a template by ID
  • createTemplate(array $data) - Create a new template
  • updateTemplate(int $id, array $data) - Update a template
  • deleteTemplate(int $id) - Delete a template
Transactional Emails
  • sendTransactionalEmail(string $to, string $subject, string $body, array $data = []) - Send a transactional email

Testing

composer test

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.

Related Packages

gsteel/postmark-php

Postmark API Client Fork for PHP 8.1

39,545 0
dansmaculotte/laravel-newsletter

Manage newsletters in Laravel

2,693 0
flobbos/laravel-cm

Complete package for Campaign Monitor integration

1,701 5
bonsi/laravel-newsletter-getresponse

Manage GetResponse newsletters in Laravel 5

1,304 1

Version History

Version Released PHP Laravel License
1.3.0 ^8.0 ^9.0|^10.0|^11.0|^12.0|^13.0 MIT
1.2 ^8.0 ^9.0|^10.0|^11.0|^12.0|^13.0 MIT
1.1 ^8.0 ^9.0|^10.0|^11.0|^12.0 MIT
1.0 ^8.0 ^9.0|^10.0|^11.0|^12.0 MIT
0.1 ^8.0 ^9.0|^10.0 MIT