pacely/mailchimp-api-v3

Laravel Version Support

Closed this issue · 3 comments

Does this package only work on Laravel version 5.x? Wasn't quite sure from the documentation.

Thanks

I am coming up with the same issue while trying to update composer. pacely/mailchimp-apiv3 dev-master requires illuminate/support ~5.0 -> satisfiable by laravel/framework[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev], illuminate/support[5.0.x-dev, 5.1.x-dev .......

I think it only works with 5.x due to the illuminate/support 5.0 requirement, which I believe is due to a dependancy on the Collection class.

I have been able to use a modified version no problem though with Laravel 4.2. I might create a pull request if there's any interest for those of us stuck on Laravel 4

In case you want a quick solution for now, just update the makeRequest function in
https://github.com/pacely/mailchimp-api-v3/blob/master/src/Mailchimp.php

To do something like this:


            $body = json_decode($response->getBody(), true);

            if (!$body) {
                return $body;
            }

            $collection = new Collection($body);

Warning though, this is not well tested, just trying it out now until I can spend more time on it and will send a pull request if it actually makes sense.

Also, this might be obvious, but I'm not using the package right now due to the composer issues. Just testing out a direct copy&paste of the MailChimp class for now.