Doubt of mailchimp and nztim / mailchimp

0

I am trying to use mailchimp in Laravel and a github repository to facilitate it. But when I send the form I get the following error:

  

Non-static method NZTim \ Mailchimp \ Mailchimp :: check () should not be   called statically

    public function correo(Request $request){
    $listId= '00000000';
    $emailAddress=$request->input('email');
    if(Mailchimp::check($listId, $emailAddress))
    return view('existente');
    else
    return 'no existe';
}

The repository is: link

    
asked by Erick López Martinez 06.07.2018 в 06:59
source

1 answer

1

I have the same error, what I did was

protected $mailchimp;

public function __construct() {
   try {
      $this->mailchimp = new Mailchimp(env('MC_KEY'));
   } 
   catch (MailchimpException $e) {
   }
}

public function index() {
   $lists = $this->mailchimp->check();
}
    
answered by 06.12.2018 в 20:36