Mercurial / mailchimp-v3-laravel-4 by Mercurial
forked from asanzred/mailchimp-v3-laravel-4

Mailchimp API V3 API Wrapper for Laravel 4
Package Data
Maintainer Username: Mercurial
Maintainer Contact: (Alberto Sanz Redondo)
Package Create Date: 2016-08-03
Package Last Update: 2016-08-03
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-02-22 03:07:35
Package Statistics
Total Downloads: 26
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Mailchimp API V3 API Wrapper for Laravel 4


Add the following to your composer.json

    "require": {
        "mercurial/mailchimpv3": "dev-master"

Add ServiceProvider in your app.php config file.

// config/app.php
'providers' => [

and instead on aliases

// config/app.php
'aliases' => [
    'Mailchimpv3' => 'Asanzred\Mailchimpv3\Facades\Mailchimpv3'


Publish the config by running:

php artisan config:publish asanzred/mailchimpv3

Now, the config file will be located under config/asanzred/mailchimpv3/config.php:


return [

    | Mailchimp API key
    | To obtain an API key, go to under your profile
    | you will find Extras -> API keys. Paste the key below.
    'apikey' => ''


There's only one method:

request($resource, $arguments = [], $method = 'GET') 

You can make these calls if needed

get($resource, array $options = [])
head($resource, array $options = [])
put($resource, array $options = [])
post($resource, array $options = [])
patch($resource, array $options = [])
delete($resource, array $options = [])


We use offset and count in the query string to paginate data, because it provides greater control over how you view your data. Offset defaults to 0, so if you use offset=1, you'll miss the first element in the dataset. Count defaults to 10.



Most endpoints don't currently support filtering, but we plan to add these capabilities over time. Schemas will tell you which collections can be filtered, and what to include in your query string.


Partial Response

To cut down on data transfers, pass a comma separated list of fields to include or exclude from a certain response in the query string. The parameters fields and exclude_fields are mutually exclusive and will throw an error if a field isn't valid in your request.


Behind Proxy

If you are behind a proxy, you can use setProxy directly on the class.

setProxy(host : string, port : int, [ssl : bool = false], [username = null], [password = null]);


Collection object

All queries will return an instance of the Illuminate\Support\Collection object, which is really easy to work with. If you don't want to use the Collection object however, you can transform it into an array using $result->toArray().

$resource = '/lists/'

$result = Mailchimpv3::request($resource, $opts,'GET');

// Returns object(Illuminate\Support\Collection)

// Returns the first item

// Returns 3 items

// Returns a JSON string

// Returns an array