How to Create a Newsletter Subscribers with Laravel
August 9, 2022
Build a free newsletter system with Laravel to email subscribers when you publish new blog posts.

This is my way of how to create or manage an easy and free internal Subscribers Newsletter with Laravel to send email notifications to the subscriber list about new content on the blog.adityacprtm.com site before switching to wordpress.
update: the blog switches to adityacprtm.dev/blog or dev.to/adityacprtm
Another solution is to use a Newsletter Subscription provider such as MailChimp. But if you don’t want to use a third party to store your Subscriber data, you can create your own with laravel using the package from mydnic/laravel-subscribers.
Installation
It is assumed that you have a laravel project ready.
We can use Composer to install, the packages will be installed automatically
codeCopycomposer require mydnic/laravel-subscribers
Then do a publish migration:
codeCopyphp artisan vendor:publish --provider=""Mydnic\Subscribers\SubscribersServiceProvider"" --tag=""subscribers-migrations""
How to Use Newsletter Subscribers
We only need to create a form, then customize it:
codeCopy<form action=""{{ route('subscribers.store') }}"" method=""post"">
@csrf
<input type=""email"" name=""email"">
<input type=""submit"" value=""submit"">
</form>
@if (session('subscribed'))
<div class=""alert alert-success"">
{{ session('subscribed') }}
</div>
@endif
Unsubscribe or Delete
Just give this link to subscribers:
codeCopy<a href=""{{ route('subscribers.delete', ['email' => $subscriber->email]) }}"">unsubscribe</a>
This line will generate a link like: /subscribers/delete?email=email@example.com
That’s it! Next, prepare a template for the email.
