-
Notifications
You must be signed in to change notification settings - Fork 15
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
Assets problem #12
Comments
Indeed there is a problem... i do not use the i'll look into this asap to find a fix. until then, a quick fix would be a url rewrite or just do not use
|
I've solved this problem creating another function helper (If I can, then I will add a PR) Steps I've follow:
"autoload": {
"files": [
"app/helpers.php"
],
}
if (! function_exists('linguist_asset')) {
/**
* Generate a linguist asset path for the application.
* @param $path
* @param null $secure
* @return string
*/
function linguist_asset($path, $secure = null)
{
$urlGenerator = app('url');
if ($urlGenerator->isValidUrl($path)) {
return $path;
}
$root = $urlGenerator->formatRoot(
$urlGenerator->formatScheme($secure)
);
$urlSegments = explode('/', $root);
if (in_array(end($urlSegments), config('linguist.enabled'))) {
$root = str_replace('/' . end($urlSegments), '', $root);
}
$index = 'index.php';
return (
str_contains($root, $index) ?
str_replace('/'.$index, '', $root) : $root
).'/'.trim($path, '/');
}
}
if (! function_exists('secure_linguist_asset')) {
/**
* Generate a linguist asset path for the application.
*
* @param string $path
* @return string
*/
function secure_linguist_asset($path)
{
return linguist_asset($path, true);
}
}
How to use?Examples:
With HTTPS:
|
Hello,
Using Laravel 5.5, and Linguist ^2.1, when using
asset
to link a style sheet or a javascript file I get 404 and the URL becomeslocalhost:8000/ar/css/.....
The text was updated successfully, but these errors were encountered: