Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

Change cloud browser to open primary custom domain (if there is one) - #296

Merged
joetannenbaum merged 2 commits into
laravel:mainfrom
JonPurvis:fix-browser-primary-domain
Nov 24, 2026
Merged

joetannenbaum merged 2 commits into
laravel:mainfrom
JonPurvis:fix-browser-primary-domain

Conversation

@JonPurvis

Copy link
Copy Markdown
Contributor

cloud browser now opens the environment's primary custom domain once it's verified, rather than always using the *.laravel.cloud vanity domain. If the custom domain isn't verified yet, or the environment doesn't have one, it still opens the vanity domain.

Noticed this on my app when I'd run the command and it would take me to my app, but logged out, then I realised it was sending me to the cloud domain and not my custom domain.

Copilot AI balanced review requested due to automatic review settings November 16, 2026 22:06
@JonPurvis JonPurvis changed the title Fix browser primary domain Change cloud browser to open primary custom domain (if there is one) Nov 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change to prefer verified primary custom domains when opening environments.

No open issues 🎉

What changed in this PR

Updates cloud browser to open an environment’s primary custom domain when its hostname is verified, falling back to the vanity domain otherwise.

Changes:

  • Hydrates the primary domain on the environment DTO and adds a browser destination helper, leaving the existing vanity URL unchanged.
  • Uses the selected URL for both browser launch and command output.
  • Adds tests for verified, unverified, and absent custom domains.
File Description
tests/​Feature/​BrowserTest.php Tests custom-domain selection and vanity-domain fallback.
app/​Dto/​Environment.php Hydrates the primary domain and adds siteUrl() selection logic.
app/​Commands/​Browser.php Opens and displays the URL returned by siteUrl().

Review effort: Balanced

@joetannenbaum

Copy link
Copy Markdown
Collaborator

Thank you!

@joetannenbaum
joetannenbaum merged commit faf62f3 into laravel:main Nov 24, 2026
4 checks passed
@JonPurvis

Copy link
Copy Markdown
Contributor Author

Good call on the SSL verification @joetannenbaum I did not think of that!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants