In your controller
if(auth()->check()) {
// Return a page for authenticated users
} else {
// Return a page for guests
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
What is a proper way to display the base URL of the app (/) for 2 different pages, depending if the user is logged in or not?
so if a user enters the base URL and he's not logged in, it will show the login.blade.php page (but still display the base URL), and if he is logged in, it will show welcome.blade.php, but still on the base URL
In your controller
if(auth()->check()) {
// Return a page for authenticated users
} else {
// Return a page for guests
}
Please or to participate in this conversation.