Wouter van Erp
Wouter van Erp

Reputation: 37

Laravel 5.7 Routing not Working for Subdomain

For my Laravel application, I want to use subdomains to link to different spas with Vue.js. The only thing I have to do is link in the web.php to the Laravel Blade file but for some reason, it's not working.

<?php

Route::domain('test.mysite.test')->group(function () { 
    return view('test'); 
});

I run Laravel Valet for my virtual host. Does anyone have an idea what the problem could be?

Upvotes: 1

Views: 1639

Answers (1)

Seymur Omarov
Seymur Omarov

Reputation: 131

Edit your code like this:

Route::domain('test.mysite.test')->group(function () {
  Route::get('/', function () {
    return view('test');
  });
});

and be sure that you registered your subdomain virtual host too

Upvotes: 4

Related Questions