The tag that @laryai sugested to publish does not exist. But is basically what I treid doing. But it just also registers my EventServiceProvider and does not Override. So I am getting duplicate events.
How to Disable Automatic Email Verification on User Registration in Laravel 11
I am attempting to stop automatically sending the verification email when a user is registered, because right now, if a user creates an account while placing an order, they receive three emails at once. I would like to reduce this to two (Welcome+Verification, Order Confirmation). I saw some older posts referring to removing the registration of SendEmailVerificationNotification listening to the Registered class. However, it seems with Laravel 11+ (and possibly 10), this is automatically registered in the Illuminate\Foundation\Support\Providers\EventServiceProvider->configureEmailVerification(). I attempted to override this EventServiceProvider and remove the code in that method, but now it seems my app is registering both Event Service Providers.
I would like to continue using the verified middleware and retain the ability to use email verification for re-sending or when a user's email changes.
Could someone point me in the right direction? Thanks in advance!
Alright... This was way simpliar that I ever would have thought... All I had was override the sendEmailVerificationNotification() method on my User model. I just did a quick check to see if created_at was newer than a minute and return if it is.
This is what I added.
public function sendEmailVerificationNotification(): void
{
if ($this->created_at > now()->subMinute()) {
return;
}
$this->notify(new VerifyEmail());
}
Please or to participate in this conversation.