Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Mailerlite Php

Mailerlite Php Laravel Package

mailerlite/mailerlite-php

Official PHP SDK for the MailerLite API, offering fluent methods to manage subscribers, campaigns, groups, segments, fields, forms, automations, and webhooks in your PHP applications.

View on GitHub
Deep Wiki
Context7

mailerlite/mailerlite-php is the official PHP SDK for the MailerLite API, giving you a fluent, object-oriented way to manage email marketing from any PHP application. It wraps the REST endpoints in a clean client, so you can create and update subscribers, build campaigns, and organize your audience without hand-writing HTTP requests.

Installed via Composer, the package ships with typed resources, PSR-compatible HTTP abstraction, and built-in error handling. Each API area has its own builder, letting you chain calls and handle responses predictably.

  • Full Subscriber, Campaign, Group, and Segment management
  • Custom fields, forms, automations, and webhooks support
  • Batch requests for high-volume operations
  • PSR-18/PSR-17 compatible HTTP layer
  • Timezone and campaign-language lookups
Frequently asked questions about Mailerlite Php
How do I install the MailerLite PHP SDK in a Laravel application?
Install it with Composer using composer require mailerlite/mailerlite-php. The SDK is framework-agnostic, so Laravel will not auto-register a service provider or config file. Create a small service or bind the client in a service provider, and pass your MailerLite API key from config/services.php or an environment variable.
Does mailerlite/mailerlite-php support Laravel 10 and Laravel 11?
The package is a plain PHP SDK rather than a Laravel package, so it is not tied to a specific Laravel release. It can be used in Laravel 10, Laravel 11, or other versions that satisfy its PHP and PSR-7/PSR-18 dependency constraints. Check the Composer requirements and test your HTTP client setup before upgrading Laravel.
Do I need a service provider or config file for MailerLite in Laravel?
No, the SDK does not ship a Laravel service provider, facade, or publishable config. You should add your own binding, such as in AppServiceProvider, and store the API key in config/services.php or the environment. Wrapping the client in an application service keeps controllers clean and makes testing easier.
What can I manage with the MailerLite PHP SDK?
The SDK covers subscribers, campaigns, groups, segments, fields, forms, automations, webhooks, campaign languages, timezones, and batch requests. It provides methods for common create, read, update, and delete operations across those resources. It is an API client, so your Laravel app still owns authorization, validation, local persistence, and business workflows.
How do I receive MailerLite webhooks in Laravel?
Use the SDK's webhook resource to create and manage the webhook subscription in MailerLite, then expose a Laravel route that accepts the incoming payload. Put processing into queued jobs and make handlers idempotent because webhook delivery and retries can overlap. The SDK helps manage webhook records; receiving, validating, and reconciling events is application-level code.
Is $subscriber->forget safe to use in production?
Treat it as a potentially destructive erasure operation and require explicit authorization, confirmation, audit logging, and environment guards before calling it. Run it through a queued job so failures are isolated and retries are controlled, and make the workflow idempotent. Also verify the exact MailerLite API semantics and test missing, already-forgotten, unauthorized, and transient failure cases.
How should I test MailerLite API calls in Laravel?
Wrap the SDK behind your own service interface and mock that interface in feature tests, or inject a mock PSR-18 HTTP client for lower-level contract tests. Cover success, unauthorized, not-found, rate-limit, API failure, and retry behavior, especially around subscriber deletion or forget. Use a MailerLite sandbox or test account where possible, and keep destructive cleanup tests isolated.
What are the main production risks of using this SDK?
The SDK depends on MailerLite API availability, rate limits, and upstream response semantics, so transient failures and throttling need retry and backoff handling. Irreversible subscriber operations create deletion and compliance risk, and partial failures can leave MailerLite and local records inconsistent. Define a source of truth, reconcile via webhooks or scheduled syncs, and log all destructive actions.
Are there Laravel-specific alternatives to mailerlite/mailerlite-php?
The official SDK is not Laravel-specific, so any Laravel wrapper or community package should be compared on maintenance, feature parity, and support for webhooks and subscriber forget. Many teams prefer a thin application service around the official SDK to avoid losing official API coverage. Evaluate whether an alternative actually reduces complexity or just adds another dependency.
How do I keep a MailerLite integration maintained over time?
Track MailerLite API changelogs and the package's releases, and update Composer dependencies deliberately with regression tests. Keep contract tests for subscribers, webhooks, rate limits, and deletion semantics, and monitor failures in production. Periodically review deprecations, local retention rules, and whether your service wrapper still matches how the SDK is used.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections