Tuesday, August 22, 2017

laravel debugger plugin

https://github.com/barryvdh/laravel-debugbar

Manage newsletters in Laravel 5

This package provides an easy way to integrate MailChimp with Laravel 5. Behind the scenes v3 for the MailChimp API is used. Here are some examples of what you can do with the package:

Please note the at the time of this writing the default merge variables in MailChimp are named FNAME and LNAME. In our examples we use firstName and lastName for extra readability.


Newsletter::subscribe('rincewind@discworld.com');

Newsletter::unsubscribe('the.luggage@discworld.com');

//Merge variables can be passed as the second argument
Newsletter::subscribe('sam.vines@discworld.com', ['firstName'=>'Sam', 'lastName'=>'Vines']);

//Subscribe someone to a specific list by using the third argument:
Newsletter::subscribe('nanny.ogg@discworld.com', ['firstName'=>'Nanny', 'lastName'=>'Ogg'], 'Name of your list');

//Subscribe or update someone
Newsletter::subscribeOrUpdate('sam.vines@discworld.com', ['firstName'=>'Foo', 'lastName'=>'Bar']);

// Change the email address of an existing subscriber
Newsletter::updateEmailAddress('rincewind@discworld.com', 'the.luggage@discworld.com');

//Get some member info, returns an array described in the official docs
Newsletter::getMember('lord.vetinari@discworld.com');

//Get the member activity, returns an array with recent activity for a given user
Newsletter::getMemberActivity('lord.vetinari@discworld.com');

//Get the members for a given list, optionally filtered by passing a second array of parameters
Newsletter::getMembers();

//Check if a member is subscribed to a list
Newsletter::isSubscribed('rincewind@discworld.com');

//Returns a boolean
Newsletter::hasMember('greebo@discworld.com');

//If you want to do something else, you can get an instance of the underlying API:
Newsletter::getApi();
Github link : https://github.com/spatie/laravel-newsletter
Other Important open source plugins : https://spatie.be/en/opensource/laravel