Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

REDIRECT TO HOME PAGE


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


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


The Sohomod On Sale page offers a wide selection of discounted furniture, including modern pieces for living rooms, bedrooms, offices, and dining spaces. It features ongoing promotions and seasonal markdowns on premium designs. Customers can further reduce their costs by using Sohomod discount codes at checkout for additional savings.


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...
   });

By moving the route for the landing page outside of the auth middleware group, it won't require authentication to access it. Users will see the landing page when they visit the root URL (/). Then, they can navigate to the login page manually when needed.

Hope this helps! Let me know if you have further questions.


yeah, thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(