Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helpers for adding domain to urls #289

Merged
merged 3 commits into from
Jul 4, 2023

Conversation

indykoning
Copy link
Member

@indykoning indykoning commented Jun 28, 2023

Turned named urls into route() calls
use the url() helper when we're certain the url starts with a /
use the to() helper if the url might start with a relative path

How Laravel generates the domain for the url can be done in multiple ways:

\Illuminate\Support\Facades\Url::formatHostUsing(fn($root, $route) => 'https://example.com');
\Illuminate\Support\Facades\Url::forceRootUrl('https://example.com');

or if you simply want to add a prefix to the url that is possible by using the X-Forwarded-Prefix header

As there are multiple ways to set this domain, like getting it from Magento, setting it in configuration, passing it from your reverse proxy i have not made any opinionated code on this.
Depending on the requirements of the project one of these can be used on a per-project basis.

Most projects will not need to change the host for url generation.

@royduin royduin merged commit ffada51 into rapidez:0.x Jul 4, 2023
@royduin
Copy link
Member

royduin commented Jul 4, 2023

Just need another one for master? 😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants