E-mail Verification Problem with Breeze and Laravel 11
With Laravel 11, I've set up a multi-guard structure using the Breeze session system. The name of the second guard I added is 'admin'.
The URL structure for the User guard is as follows: prefix: app name: app.
The URL structure for the Admin guard is as follows: prefix: panel name: panel.
Membership operations in the Admin guard are performed by registered administrators. External membership is not allowed, hence there's no email confirmation structure for membership. However, external users can join the User guard. There are no issues with logging in, password resetting, updating profile information, changing passwords, or deleting accounts in both guard structures, except for membership.
For password reset, emails are sent to email addresses. However, individuals who are members of the User guard and those who update their email addresses in both guards' profile pages need to confirm their email addresses.
When a request is made, a warning page appears stating that the email has not been confirmed, but the email confirmation mail doesn't seem to be sent at all. In fact, on this warning page, there's a link to resend the email. I click on it, and it says "Your email has been sent," but it doesn't actually go through.
The actions I've taken are:
-
I created a new EventServiceProvider because there is a 'event(new Registered($user));' code in the user creation method in the RegisteredUserController file, and I added the following code: https://gist.github.com/bulentsakarya/d4e228a576193ad28803d5ea27aa85b5#file-1-event
-
I activated the MustVerifyEmail line in my User model and implemented it in the class. https://gist.github.com/bulentsakarya/d4e228a576193ad28803d5ea27aa85b5#file-2-user-model
-
I created a Notification named UserVerifyEmail to customize the mail content and add 'app' to the beginning of the link in the mail. The customized mail content is as follows: https://gist.github.com/bulentsakarya/d4e228a576193ad28803d5ea27aa85b5#file-3-mail-content-notitification
The link structure is as follows: https://gist.github.com/bulentsakarya/d4e228a576193ad28803d5ea27aa85b5#file-4-link-notification
-
I created an AppServiceProvider and added the following code to the boot method: https://gist.github.com/bulentsakarya/d4e228a576193ad28803d5ea27aa85b5#file-5-app-service-provider
-
I made the following addition to my User model: https://gist.github.com/bulentsakarya/d4e228a576193ad28803d5ea27aa85b5#file-6-user-model-notify
-
My routes are as follows: https://gist.github.com/bulentsakarya/d4e228a576193ad28803d5ea27aa85b5#file-7-routes
How can I solve the issue of not being able to send emails?
Please or to participate in this conversation.