I use Elixir to compile my less files
elixir(function(mix) {
mix.less([
"../../../vendor/uikit/uikit/src/less/uikit.less",
"main.less"
], 'public/css/style.css').version("public/css/style.css");
});
then I try to use css file like
<link rel="stylesheet" type="text/css" href="{{ elixir('css/style.css') }}">
but I result I get http://localhost:8080/build/css/style-a3ade8736f.css 404 (Not Found)
I use XAMMP so my url looks like http://localhost:8080/ad/public/
When I try to add 'piblic/' word in css href like
<link rel="stylesheet" type="text/css" href="public/{{ elixir('css/style.css') }}">
I get an error to like
http://localhost:8080/ad/public/public//build/css/style-a3ade8736f.css 404 (Not Found)
How to fix href?
You can call Elixir function inside asset() or url().
Like this:
{{ asset(elixir('css/style.css')) }}
Or
{{ url(elixir('css/style.css')) }}
This thread solves the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With