Laravel Valet and subdomains

1.9k Views Asked by At

I have a problem with Laravel Valet and make subdomains of different laravel's projects.

I have a folder called Sites, in this folder I have 3 folders:

  • myapp
  • foo.myapp
  • bar.myapp

Every folder is a Laravel Project unique and different. I try to access to:

  • myapp.test
  • foo.myapp.test
  • bar.myapp.test

myapp.test works great!... But if I try to access to foo.myapp.test or bar.myapp.test it show myapp.test

I tryed with valet park Also valet link myapp.test, valet link foo.myapp.test, valet link bar.myapp.test

But nothing works.

What I'm doing bad? Or what I need to do for it works?

PD: I need subdomain works, if I change the name to "foo-myapp" doesn't work for my.

Thanks!

UPDATED:

Valet links

| Site | SSL | URL | Path

| bar.myapp | | http://bar.myapp.test | /Users/xxxxxx/Projects/Sites/bar.myapp

| foo.myapp | | http://foo.myapp.test | /Users/xxxxxx/Projects/Sites/foo.myapp

| myapp | | http://myapp.test | /Users/xxxxxx/Projects/Sites/myapp

1

There are 1 best solutions below

1
On

In my case I try solve it by remove valet park by running valet forget command on parked directory, then link manually for project that you need to use them for creating sub domain and it's working.

I think the reason its doesnt work because valet park and valet link cant be used together because valet park will overwrite some url logic created by valet link on that directory.