public function getLists() { if (!self::$lists) { $mc = new \Mailchimp\Mailchimp($this->config()->get('api_key')); /** @var \Illuminate\Support\Collection $lists */ $lists = $mc->request('lists', ['fields' => 'lists.id,lists.name', 'count' => 100]); self::$lists = $lists->lists('name', 'id')->toArray(); } return self::$lists; }
public function getLists() { if (!self::$lists) { $mc = new \Mailchimp\Mailchimp($this->config()->get('api_key')); // Check for proxy settings if ($this->config()->get('proxy')) { $mc->setProxy($this->config()->get('proxy_url'), $this->config()->get('proxy_port'), $this->config()->get('proxy_ssl'), $this->config()->get('proxy_user'), $this->config()->get('proxy_password')); } /** @var \Illuminate\Support\Collection $lists */ $lists = $mc->request('lists', ['fields' => 'lists.id,lists.name', 'count' => 100]); self::$lists = $lists->lists('name', 'id')->toArray(); } return self::$lists; }