0
votes

I followed the instruction of the Laravel documentation 7x for Email Verification. I didn't do it at the very beginning and before this I made changes to the the users table adding columns like firstnane, familyname, city etc. Since then I could register correctly without any email verification. Today I decided to add this functionality but it doesn't work. The register process is still going on but there is no email sent and the user is directly logged. I use the

MAIL_MAILER=log

in my .env and other mails are correctly sent and visible in the logs file.

Here is the auth routes

Auth::routes(['verify' => true]);

I have a email_verified_at column in the users table.

Any idea ?

1
did you make your User model implement the MustVerifyEmail contract/interface?lagbox
check your .env MAIL_DRIVER=smtpTheDon
MAIL_MAILER=log menas, your mail won't be sent. Your app will save all email in the log /storage/log directory, loop up here, you will see the email message. You need to set as MAIL_MAILER=smtp or any other mail driversta
I forgot it. I just added the use statement but not the implement.Meaulnes
Now email is sent but the user is still directly connected even before confirming email. Is this the normal behavior?Meaulnes

1 Answers

1
votes

Most likely your User model is not implementing the Illuminate\Contracts\Auth\MustVerifyEmail contract/interface.

use Illuminate\Contracts\Auth\MustVerifyEmail;
...

class User extends Model implements MustVerifyEmail

"Once this interface has been added to your model, newly registered users will automatically be sent an email containing an email verification link." - Laravel 7.x Docs - Email Verification - Model Preparation