Download the PHP package theihasan/laravel-mailerlite without Composer
On this page you can find all versions of the php package theihasan/laravel-mailerlite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download theihasan/laravel-mailerlite
More information about theihasan/laravel-mailerlite
Files in theihasan/laravel-mailerlite
Package laravel-mailerlite
Short Description A Laravel wrapper for the official MailerLite PHP SDK
License MIT
Homepage https://github.com/theihasan/laravel-mailerlite
Informations about the package laravel-mailerlite
Laravel MailerLite
A comprehensive, fluent Laravel wrapper for the official MailerLite PHP SDK. Provides strongly-typed DTOs, expressive builders that read like English, robust services with granular exception handling, contracts for testability, and comprehensive test coverage.
🔗 Built For: This package is specifically designed for Filament MailerLite Plugin - a complete MailerLite management interface for Filament Admin.
📦 Uses Official SDK: Built on top of the official MailerLite PHP SDK for reliable API integration.
⚠️ Plan Requirements: Campaign and Automation features require MailerLite Advanced Plan. Subscribers, Groups, Fields, and Webhooks work on all plans including Free.
Table of Contents
- Installation
- Configuration
- Subscribers
- Groups
- Fields
- Campaigns ⚠️ Advanced Plan Required 🚧 Under Development
- Segments
- Automations ⚠️ Advanced Plan Required 🚧 Under Development
- Webhooks
- API Limitations & Plan Requirements
- Testing
Installation
The package will auto-register via Laravel's package discovery.
Publish Config
Configuration
Add your MailerLite API key to .env
:
Configuration file (config/mailerlite.php
):
Subscribers
How to Get All Subscribers
How to Create a Subscriber
How to Fetch a Subscriber
How to Update a Subscriber
How to Delete a Subscriber
How to Get Total Subscriber Count
How to Unsubscribe/Resubscribe a Subscriber
How to Manage Subscriber Groups
How to Import Subscribers in Bulk
Groups
How to Get All Groups
How to Create a Group
How to Fetch a Group
How to Update a Group
How to Delete a Group
How to Manage Group Subscribers
Fields
How to Get All Fields
How to Create a Field
How to Fetch a Field
How to Update a Field
How to Delete a Field
How to Get Field Usage Stats
Campaigns 🚧 Under Development
⚠️ Notice: Campaign features are currently under active development. Some functionality may change in future releases.
📋 Plan Requirements: Campaign features vary by MailerLite plan:
- Free Plan: Can create
regular
campaigns (basic email campaigns)- Growing Business Plan: Adds
resend
andmultivariate
campaign types- Advanced Plan: Full API access + advanced content features
💡 Quick Start for Free Users: Use
.forFreePlan()
method for guaranteed compatibility.
How to Get All Campaigns
How to Create a Campaign
Plan-Specific Error Handling
💡 Pro Tips:
- Use
.forFreePlan()
method for guaranteed free plan compatibility- Campaign name is required by MailerLite API (auto-generated from subject if not provided)
- Use group IDs for better performance, or group names (auto-resolved to IDs)
- Both HTML and plain text content are recommended but only one is required
regular
campaigns work on all plans including Freeresend
andmultivariate
require Growing Business or Advanced Plan
How to Fetch a Campaign
How to Update a Campaign
How to Delete a Campaign
How to Manage Campaign Operations
Segments
⚠️ Important Note: Segment creation is NOT supported by the MailerLite API. Segments must be created through the MailerLite web interface. Once created, you can manage them via this package.
How to Get All Segments
How to Create a Segment
❌ Segments cannot be created via API. Use the MailerLite web interface instead:
✅ To create segments:
- Go to MailerLite Dashboard
- Navigate to Subscribers → Segments
- Click Create Segment
- Set up your filters using the visual interface
- Use this package to manage the segment via API
How to Fetch a Segment
How to Update a Segment
How to Delete a Segment
How to Manage Segment Operations
Supported vs Unsupported Operations
Operation | Supported | Method |
---|---|---|
List segments | ✅ | MailerLite::segments()->all() |
Get segment subscribers | ✅ | MailerLite::segments()->getSubscribers($id) |
Update segment name | ✅ | MailerLite::segments()->update($id, $dto) |
Delete segment | ✅ | MailerLite::segments()->delete($id) |
Create segment | ❌ | Use web interface |
Update segment filters | ❌ | Use web interface |
Activate/deactivate | ❌ | Use web interface |
Automations 🚧 Under Development
⚠️ Notice: Automation features are currently under active development. Some functionality may change in future releases.
⚠️ MailerLite Plan Requirement: Automation creation and management requires a MailerLite Advanced Plan or higher. Free and Basic plans may have limited automation features. Some operations may fail with plan-related restrictions.
How to Get All Automations
How to Create an Automation
How to Fetch an Automation
How to Update an Automation
How to Delete an Automation
How to Manage Automation Operations
Webhooks
How to Get All Webhooks
How to Create a Webhook
How to Fetch a Webhook
How to Update a Webhook
How to Delete a Webhook
How to Manage Webhook Operations
Testing
Running Tests
Example Test
API Limitations & Important Notes
MailerLite Plan Requirements
⚠️ Important: Some features require specific MailerLite subscription plans:
Feature | Free Plan | Growing Business Plan | Advanced Plan | Required For |
---|---|---|---|---|
Subscribers | ✅ Full Access | ✅ Full Access | ✅ Full Access | All operations |
Groups | ✅ Full Access | ✅ Full Access | ✅ Full Access | All operations |
Fields | ✅ Full Access | ✅ Full Access | ✅ Full Access | All operations |
Segments | ✅ View Only | ✅ Full Access | ✅ Full Access | Create/Update via web UI |
Campaigns 🚧 | ✅ Regular Only | ✅ + Resend/Multivariate | ✅ Full Access | API Creation/Management |
Automations 🚧 | ❌ Limited | ✅ Basic | ✅ Full Access | Advanced Features |
Webhooks | ✅ Full Access | ✅ Full Access | ✅ Full Access | All operations |
Common Plan-Related Errors:
MailerLite API Resource Limitations
Due to MailerLite API constraints, some resources don't have direct "get by ID" endpoints. This package implements intelligent workarounds using search-through-list functionality:
Resources with Search-Based Retrieval
Resource | Limitation | Package Solution |
---|---|---|
Campaigns | No single campaign endpoint | Searches through campaign list by name |
Segments | No single segment endpoint | Searches through segment list by name |
Automations | No single automation endpoint | Searches through automation list by name |
Webhooks | No single webhook endpoint | Searches through webhook list by URL |
How Search-Based Functionality Works
Performance Considerations
⚠️ Important Performance Notes:
- First-time searches may be slower as they iterate through API pages
- Exact matches are faster than partial searches
- Consider caching results for frequently accessed resources
- Use specific names to improve search efficiency
Segment Creation
❌ Not supported via API - Segments must be created through the MailerLite web interface. Once created, you can manage them via this package.
Campaign Requirements
✅ Name field is required - MailerLite API requires a campaign name. If not provided, it's auto-generated from the subject line.
Group Resolution
✅ Automatic group name → ID resolution - You can use group names or IDs interchangeably.
Search Operation Error Handling
Best Practices for Search-Based Operations
Error Handling
The package provides granular exception handling:
Common Plan-Related Errors & Solutions
License
The MIT License (MIT). Please see License File for more information.
Credits
- Abul Hassan - Package Author
- Built for Filament MailerLite Plugin
- Built on Official MailerLite PHP SDK
- Powered by Spatie Laravel Package Tools
All versions of laravel-mailerlite with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0|^11.0
mailerlite/mailerlite-php Version ^1.0