๐ Create a new Laravel app
๐ Install the Breeze package. In my case, I installed the Breeze package with the option of --๐ถ๐ป๐ฒ๐ฟ๐๐ถ๐ฎ
3/8 โจโจ Register a new User โจโจ
๐ Implement the MustVerifyEmail on the User model
๐ Register a new User
๐ The RegisteredUserController::store dispatches the Registered event
๐ Event listener, SendEmailVerificationNotification sends User an email to verify
4/8 โจโจ User Login (without being verified) 1/4 โจโจ
๐ When a user successfully logins, the user is redirected to /๐ฑ๐ฎ๐๐ต๐ฏ๐ผ๐ฎ๐ฟ๐ฑ route
The /dashboard route, defined inside ๐ฟ๐ผ๐๐๐ฒ๐\๐๐ฒ๐ฏ.๐ฝ๐ต๐ฝ file, has two route middlewares assigned: ๐ฎ๐๐๐ต & ๐๐ฒ๐ฟ๐ถ๐ณ๐ถ๐ฒ๐ฑ
5/8 โจโจ User Login (without being verified) 2/4 โจโจ
That's defined inside \๐๐ฝ๐ฝ\๐๐๐๐ฝ\๐๐ฒ๐ฟ๐ป๐ฒ๐น.๐ฝ๐ต๐ฝ - $routeMiddleware property
6/8 โจโจ User Login (without being verified) 3/4 โจโจ
๐ An un-verified user is redirected to '/dashboard' upon login.
๐ The user is not yet verified & because the 'verified' route middleware is assigned on '/dashboard' route, the user is redirected to '/verify-email' route
7/8 โจโจ User Login (without being verified) 4/4 โจโจ
5. At this stage, the user can request to send the verification email again or log out.
8/8 โจโจ The End โจโจ
That's it!
If you like to uncover more ๐บ๐ฎ๐ด๐ถ๐ฐ inside Laravel just comment down your request and I will do my best to cover them in future tweets ๐
Stay tuned
โข โข โข
Missing some Tweet in this thread? You can try to
force a refresh