Unable to use spatie/laravel-newsletter

Posted 8 months ago by CraigDaviess

I'm looking to integrate Mailchimp into my application and allow my customers to subscribe for the mailing list. I came across the spatie/laravel-newsletter package which looked to be not only the perfection solution, but also extremely easy to implement (or so I thought).

  1. I used composer to require the package and also published the config file.
  2. I have a basic HTML form that passes information to my pages controller file.
  3. When I try to test the feature, I get a vendor related error:

"Type error: Return value of Spatie\Newsletter\NewsletterList::getId() must be of the type string, null returned"

It's complaining about a specific part in the following file:

\vendor\spatie\laravel-newsletter\src\NewsletterList.php

public function getId(): string { return $this->properties['id']; }

I've tried updating composer but there's nothing to update or install. The package is meant to have very little installation steps so I really have no idea where to go from here.

Hopefully someone can point me in the right direction? :)

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.