1 year ago

#302276

test-img

Muhammah Anisuzzaman

Problem in Laravel Middleware Auth and Verified Routing using Laravel Fortify "Register Email Verification"

I have successfully configured all the facilities using Laravel Fortify but I have faced a little problem in middleware routing that is I know that When we try to apply email verification we use "Auth" and "Verified" middleware to achieve it. Like...

Route::get('/', function () {
    return view('home');
})->middleware(['auth', 'verified']);

It works. But I can't go home page, it redirected me to the login page. When I remove Auth Middleware and try to go home page, it also redirected me to the login page. If I remove Verified Middleware and try to register, it redirected me to the home page with logged-in instead of to go Email Verify Message Page But the email was successfully sent.

How to solve this problem, when an unregistered user goes to the home page and sees Login in Navigation like E-commerce Website and besides that when a user tries to register, the email has to verify and redirect to home page.

laravel-8

laravel-middleware

laravel-fortify

0 Answers

Your Answer

Accepted video resources