Skip to content

Conversation

@arturmamedov
Copy link

Why?
Because when we install Laravel in to a sub folder (ex: /laravelapp) we need to refer all our assets urls to this subfolder.

And laravel stuff yet do this in example Html::script('') return http://domain.com/laravelapp because it look what is set in app.asset_url

Also all other Theme::style/script/image/linkAsset() will return url with subfolder included http://domain.com/laravelapp

But not for Theme::url() that use url() helper of Laravel that generate url from root and not in accord with config app.asset_url
so we need to replace it to asset() that work with assets and not app root url

Why? 
Because when we install Laravel in to a sub folder (ex: /laravelapp) we need to refer all our assets urls to this subfolder.

And laravel stuff yet do this in example `Html::script('')` return `http://domain.com/laravelapp` because it look what is set in `app.asset_url`

Also all other `Theme::style/script/image/linkAsset()`  will return url with subfolder included `http://domain.com/laravelapp`

But not for `Theme::url()` that use `url() helper` of Laravel that generate url from root and not in accord of condif `app.asset_url` so we need to replace it to `asset()` that work with asset and not app url's
@arturmamedov
Copy link
Author

Or another proposal can be the creation of asset() method and secureAsset() like in Laravel UrlGenerator but in this way i think url() method become unused

Set root url to `/subfolder` and check if theme builder return correct path to assets also in it
@arturmamedov
Copy link
Author

This test is not correct anyway :( cause i can't reproduce the subfolder installation in test. Laravel set app.url and app.asset_url for this, but in test i can't set it.
The only way is to forceRootUrl() but this is not standard.

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.

1 participant