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.
Architecture fit
subscribers, campaigns, groups, segments, fields, forms, automations, webhooks, e-commerce, batch), constructed once with new MailerLite(['api_key' => ...]) and driven through method calls that pass plain arrays.mailerlite/laravel-newsletter wrapper is the pragmatic choice; for campaign/automation/segment orchestration, this SDK plus a thin internal adapter is the right shape.Integration feasibility
composer require mailerlite/mailerlite-php, a config entry, a singleton binding, and a smoke call. The README is above average — per-resource examples, API doc links, and a Testing section — so a mid-level PHP developer can spike a subscriber sync in under a day.guzzlehttp/psr7 are already present, so PSR discovery normally resolves — but the README's own troubleshooting note ("Could not find resource using any discovery strategy") is the single most common install failure and should be pre-empted by declaring the adapter explicitly rather than trusting discovery.Technical risk
subscribers->create and batch->send must be established empirically before you put them behind a queue with automatic retries.Key questions
subscribers->create upsert on existing email, and is it safe to retry blindly?active/unsubscribed) must not silently overwrite local compliance state.Stack fit
services.mailerlite.key from config/services.php and MAILERLITE_API_KEY from env. Keep the vendor class out of controllers and jobs; expose an application-owned interface (AudienceService) so the SDK is swappable and mockable.Illuminate\Support\Facades\Http — Laravel's client is not PSR-18 and an adapter adds a failure surface for no gain.Migration path
mailerlite/laravel-newsletter is already installed for signup forms, do not rip it out: it and this SDK target different surfaces. Run them side by side and consolidate only when you need campaign, segment, or automation control.mailerlite_subscriber_id on the local entity to avoid email-keyed lookups on every write.Compatibility
composer why-not for Guzzle and php-http/discovery conflicts during the spike rather than during release. PHP 8.4 deprecations should be verified against the current release, not assumed.Sequencing
groups->get, fields->get) in staging with a scoped key.Maintenance
Support
Scaling
Failure modes
How can I help you explore Laravel packages today?