http = Http::withBasicAuth( config('services.listmonk.username'), config('services.listmonk.password') ) ->withHeaders(['Accept' => 'application/json']) ->baseUrl(config('services.listmonk.base_url')); } /** * Retrieve all Listmonk user accounts. * * @return array * * @throws ConnectionException */ public function getUsers(): array { return $this->http ->get('/users') ->json('data') ?? []; } /** * Retrieve all mailing lists with their subscriber counts. * * @return array * * @throws ConnectionException */ public function getLists(): array { return $this->http ->get('/lists', ['per_page' => 'all']) ->json('data.results') ?? []; } }