so I created a new laravel project and use npm run dev to generate my css file inside public folder.
like my last project i tried to load my CSS like this
<link href="{{ URL::asset('/css/app.css') }}" rel="stylesheet" type="text/css">
but that doesn't work. my folder structure is like this
public
css
app.css
I checked a lot of posts but non of them worked. the only way to load the file is like this
<link href="{{ mix('/css/app.css') }}" rel="stylesheet" type="text/css" >
or
<link href="/css/app.css" rel="stylesheet" type="text/css" >
my question is why asset helper don't work ?
i tried changing the url, changing env 'ASSET_URL', etc
I know this is a really elementary issue, but this question are making me crazy,
btw my last project laravel version was 7 but this one version is 8
My Answer:
php
But for some reason, the asset helper is not working in my new project. I have tried running `php artisan cache:clear` and `php artisan config:clear` but it still doesn't work.
I also tried using the `mix()` helper function like this:
php
But that also didn't work.
I'm not sure what else to try. Any help would be appreciated.
Rate this post
4 of 5 based on 8309 votesComments