Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ryan@shiftsolutions.io's avatar

Running multiple projects Laravel Herd on subdomains?

I have a Laravel project i'm running locally with Laravel Herd at. The local URL for example would be mywebsite.test.

I have a Flarum forum i want to run as a subdomain at community.mywebsite.test. Can Laravel Herd support this locally?

I need it because I'm trying to wire up some SSO so my users only have to login on the main site and not double login again on the Flarum forum but i believe i can't unless the resulting cookie is on the same domain.

1 like
5 replies
Snapey's avatar
Snapey
Best Answer
Level 122

did you try herd link community.mywebsite ?

Edit: sorry, wrong command, I fixed it

7 likes
ryan@shiftsolutions.io's avatar

Oh dang, I must've missed that command in the docs. Thanks!!

Haven't completed the sso logic but the Flarum site loads from the subdomain now so i have hope it'll work now.

troccoli's avatar

On an unrelated note, this made my day.

I was trying to share the session between two apps and Chrome was not setting the cookie because the domain was .test. I didn't want to change the TLD as it is not recommended in Herd.

Then I came across this post and boom!!.

I linked the apps to app1.example.test and app2.example.test and change the session domain to .example.test and it all worked.

Thanks @snapey

Pyerro's avatar

I have a multiligual site with subdomains:

  • en.mysite.test
  • it.mysite.test
  • de.mysite.test

All subdomains point to the same project, I have internal language routing. I was looking for exactly the same thing, thanks for this tip: herd link de.mysite.test did the trick.

1 like
strafe's avatar

@Pyerro What did your directory setup look like? I think I need something similar to what you had.

Main main laravel application should be on: platform.mysite.test

Another site which should have access to the main project codebase (all within the platform.mysite.test) should be on: website.mysite.test.

So within my Herd (sites) directory, do I have two directories, the main laravel application inside platform.mysite.test and an empty one inside website.mysite.test.

Thanks!

Please or to participate in this conversation.