Laravel route exist but unable to view page

Viewed 163

I have been invited to collaborate on a laravel 7 project and I have been able to set up the project locally on a windows 10 system using wamp server. While reviewing the project, I noticed the plan is to use subdomain routing. I am currently tasked with setting up the blade templates and I want to test the route but I can't get the route to work correctly even though the routes exist. This is what the routes look like enter image description here

When i try viewing the page for realestate by calling the url like this realestate.localhost:8000 I get the connection error below enter image description here

The route is inside routes/realestate.php folder and its using a closure

<?php

use Illuminate\Support\Facades\Route;

Route::get('/', function () {
    return 'Realestate Routes';
});

What is the right way to call the route in my local enviroment on windows?

2 Answers

I'm not sure if your environment is different from mine, but make sure you're accessing via http:// and not https://

I just saw your Route code - it's been a long day, sorry :P Try reading up on Subdomain routing here.

Your Route should look like this:

Route::domain('realestate.localhost')->group(function () {
    Route::get('/', function () {
        return 'Hello, world!'
    });
    
    // all other routes for realestate.localhost go in here
});
Related