Reputation: 63
I'm trying to accomplish what facebook does
When you go to facebook, you're greeted with the login page at the / route
Once logged in, you're now greeted with the newsfeed, but still at the / route
I also need to be able to attach the verified middleware to the auth side
I tried making a HomeController and putting:
if(Auth::check()) {
//return dashboard view
}else{
//return guest view
}
This works, but I have no way to force email verification or any other middlewares other than the general auth middleware. If I attach the verified auth on the / route, it obviously forces that for both guest and auth
Thank you
Upvotes: 0
Views: 146
Reputation: 63
For anyone else trying to do similar, I found out I can achieve this by putting the following line into the HomeController:
if(Auth::user()->email_verified_at == null){
return view('auth.verify-email');
}
Upvotes: 0