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

[5.4] Don't wrap asset path in default domain #17727

Merged
merged 1 commit into from
Feb 2, 2017

Conversation

dwightwatson
Copy link
Contributor

This PR is made in reference to laravel/ideas#392. In essence this brings the mix helper function into line with the old elixir helper function by just returning a relative path to the compiled asset, rather than an absolute path. This is helpful when the assets are served from another domain, such as a CDN.

In order to do it as-is you would need to strip the default domain from the return value of the function and replace it with the alternate domain, which doesn't feel like all that great of a solution. Either way, by default I think it makes more sense to return a relative path rather than an absolute one.

One alternative would be to add another configuration variable, perhaps an asset_url that would be used when generating asset links - it could fallback to the default domain when it isn't set.

I'm not entirely sure if this is a breaking change or not... I can't see why it would be necessarily as it's always going to return an absolute URL with the default domain, and now it's just going to be a relative URL on that same domain.

@taylorotwell taylorotwell merged commit 55efbf0 into laravel:5.4 Feb 2, 2017
@GrahamCampbell GrahamCampbell changed the title Don't wrap asset path in default domain [5.4] Don't wrap asset path in default domain Feb 2, 2017
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