I am using Starterkit Metronic Laravel 10.0 and when I try to visit root (/) it automatically redirect to login page. I want to show a landing page and open login page when user click login button. How can I do this
Hi,
Apologies for the delay.
To achieve what you want, you'll need to adjust the route configuration in your Laravel application. Here's what you can do:
1. Open the `/routes/web.php` file in your Laravel project.
2. Find the route definition for the root (`/`) URL.
3. Ensure that the route pointing to the homepage (landing page) is outside of the `auth` middleware group. By default, Laravel redirects unauthenticated users to the login page when they try to access routes within the `auth` middleware group.
4. Move the route definition for the homepage outside of any middleware groups, like this:
// Route for landing page (outside of auth middleware)
Route::get("/", [LandingPageController::class, "index"]);
// Routes within the auth middleware group
Route::middleware(["auth"])->group(function () {
// Your authenticated routes here
Route::get("/dashboard", [DashboardController::class, "index"]);
// Other authenticated routes...
});
yeah, thanks